Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antidot-framework/tactician-adapter
Tactician Command Bus PSR-11 compatible factories
https://github.com/antidot-framework/tactician-adapter
command-bus psr-11 tactician
Last synced: 3 days ago
JSON representation
Tactician Command Bus PSR-11 compatible factories
- Host: GitHub
- URL: https://github.com/antidot-framework/tactician-adapter
- Owner: antidot-framework
- License: bsd-2-clause
- Created: 2020-09-05T19:05:14.000Z (about 4 years ago)
- Default Branch: 0.1.x
- Last Pushed: 2021-11-20T09:13:47.000Z (almost 3 years ago)
- Last Synced: 2024-07-30T20:05:15.719Z (4 months ago)
- Topics: command-bus, psr-11, tactician
- Language: PHP
- Homepage: https://antidotfw.io
- Size: 42 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Antidot Framework Tactician Adapter
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE.md)
[![Build Status][ico-travis]][link-travis]
[![Coverage Status][ico-scrutinizer]][link-scrutinizer]
[![Quality Score][ico-code-quality]][link-code-quality]
[![Total Downloads][ico-downloads]][link-downloads]## Getting started
### Installation
````
composer require antidot-fw/tactician
````### Config
Create `command-bus.global.php` file inner config autoload directory.
````php
[
'invokables' => [
\App\Handler\PingHandler::class => \App\Handler\PingHandler::class,
]
],
'command-bus' => [
'handler-map' => [
\App\Command\PingCommand::class => \App\Handler\PingHandler::class
],
],
];
````Example command and handler.
````php
$this->bus->handle(new PingCommand())]);
}
}
````## Modify Command Bus
You can modify the entire command bus to meet the needs of your project.
This is default config.
````php
[
'locator' => \League\Tactician\Handler\Locator\HandlerLocator::class,
'inflector' => \League\Tactician\Handler\MethodNameInflector\MethodNameInflector::class,
'extractor' => \League\Tactician\Handler\CommandNameExtractor\CommandNameExtractor::class,
'middleware' => [
\League\Tactician\Plugins\LockingMiddleware::class,
\League\Tactician\Logger\LoggerMiddleware::class,
\League\Tactician\CommandEvents\EventMiddleware::class,],
],
];
````## Query Bus
You can use a query bus too, the difference with the command bus is that the query bus will always return an object.
```php
[
'locator' => 'query_bus.handler_locator',
'inflector' => \League\Tactician\Handler\MethodNameInflector\MethodNameInflector::class,
'extractor' => \League\Tactician\Handler\CommandNameExtractor\CommandNameExtractor::class,
'middleware' => [],
],
];
```[ico-version]: https://img.shields.io/packagist/v/antidot-fw/tactician.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-BSD%202--Clause-brightgreen.svg?style=flat-square
[ico-travis]: https://img.shields.io/scrutinizer/build/g/antidot-framework/tactician-adapter.svg?style=flat-square
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/antidot-framework/tactician-adapter.svg?style=flat-square
[ico-code-quality]: https://img.shields.io/scrutinizer/g/antidot-framework/tactician-adapter.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/antidot-fw/tactician.svg?style=flat-square[link-packagist]: https://packagist.org/packages/antidot-fw/tactician
[link-travis]: https://scrutinizer-ci.com/g/antidot-framework/tactician-adapter/
[link-scrutinizer]: https://scrutinizer-ci.com/g/antidot-framework/tactician-adapter/code-structure
[link-code-quality]: https://scrutinizer-ci.com/g/antidot-framework/tactician-adapter/badges/coverage.png?b=master
[link-downloads]: https://packagist.org/packages/antidot-fw/tactician
[link-author]: https://github.com/kpicaza
[link-contributors]: ../../contributors