ferodss/tactician-pimple-service-provider

Pimple Tactician service provider

dev-master 2016-01-29 11:16 UTC

This package is not auto-updated.

Last update: 2024-11-09 19:45:38 UTC


README

Build Status License

Provides Tactician as service to Pimple container.

Basesd on Atriedes Silex service provider and official tactician bundle

Requirements

  • PHP >= 5.6
  • Pimple >= 3.0
  • Tactician >= 1.0

Installation

composer require ferodss/tactician-pimple-service-provider

Usage

Register Tactician service provider

$container->register(new TacticianServiceProvider());

Middlewares

By default, the only Middleware enabled is the Command Handler support which will be automatically pushed to the end of middlewares array.

You can add your own middlewares using tactician.middlewares option.

$container->register(new TacticianServiceProvider(), [
    'tactician.middlewares' => [
        $container['tactician.middleware.locking'],
    ],
]);

As Tactician provides only LockingMiddleware built in, there is just tactician.middleware.locking registered and ready to use on container.

Handler method

Handler method inflector is registered as tactician.inflector option. Available options are class_name, class_name_without_suffix, invoke or handle. Default to handle

See more about inflectors

Configuring command handlers

A command handle MUST be registered as app.command.<command name descamelized>_handler, so if you have a command called RegisterUserCommand you probably have a RegisterUserHandler which must be registered as app.command.register_user_handler

Licence

Copyright (c) 2016 Felipe Rodrigues

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.