{"id":19327679,"url":"https://github.com/antidot-framework/tactician-adapter","last_synced_at":"2026-03-02T21:05:02.616Z","repository":{"id":46013204,"uuid":"293137991","full_name":"antidot-framework/tactician-adapter","owner":"antidot-framework","description":"Tactician Command Bus PSR-11 compatible factories ","archived":false,"fork":false,"pushed_at":"2021-11-20T09:13:47.000Z","size":43,"stargazers_count":0,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"0.1.x","last_synced_at":"2025-02-27T18:36:18.912Z","etag":null,"topics":["command-bus","psr-11","tactician"],"latest_commit_sha":null,"homepage":"https://antidotfw.io","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antidot-framework.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"kpicaza"}},"created_at":"2020-09-05T19:05:14.000Z","updated_at":"2021-11-20T09:13:50.000Z","dependencies_parsed_at":"2022-08-02T15:30:09.487Z","dependency_job_id":null,"html_url":"https://github.com/antidot-framework/tactician-adapter","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antidot-framework%2Ftactician-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antidot-framework%2Ftactician-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antidot-framework%2Ftactician-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antidot-framework%2Ftactician-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antidot-framework","download_url":"https://codeload.github.com/antidot-framework/tactician-adapter/tar.gz/refs/heads/0.1.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250328083,"owners_count":21412554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-bus","psr-11","tactician"],"created_at":"2024-11-10T02:18:08.441Z","updated_at":"2026-03-02T21:04:57.582Z","avatar_url":"https://github.com/antidot-framework.png","language":"PHP","funding_links":["https://github.com/sponsors/kpicaza"],"categories":[],"sub_categories":[],"readme":"# Antidot Framework Tactician Adapter\n\n[![Latest Version on Packagist][ico-version]][link-packagist]\n[![Software License][ico-license]](LICENSE.md)\n[![Build Status][ico-travis]][link-travis]\n[![Coverage Status][ico-scrutinizer]][link-scrutinizer]\n[![Quality Score][ico-code-quality]][link-code-quality]\n[![Total Downloads][ico-downloads]][link-downloads]\n\n## Getting started\n\n### Installation\n\n````\ncomposer require antidot-fw/tactician\n````\n\n### Config\n\nCreate `command-bus.global.php` file inner config autoload directory.\n\n````php\n\u003c?php\n// command-bus.global.php\n\nreturn [\n    'dependencies' =\u003e [\n        'invokables' =\u003e [\n            \\App\\Handler\\PingHandler::class =\u003e \\App\\Handler\\PingHandler::class,\n        ]\n    ],\n    'command-bus' =\u003e [\n        'handler-map' =\u003e [\n            \\App\\Command\\PingCommand::class =\u003e \\App\\Handler\\PingHandler::class\n        ],\n    ],\n];\n````\n\nExample command and handler.\n\n````php\n\u003c?php\n\nnamespace App\\Command;\n\nclass PingCommand\n{\n\n}\n````\n\n````php\n\u003c?php\n\nnamespace App\\Handler;\n\nuse App\\Command\\PingCommand;\n\nclass PingHandler\n{\n    public function __invoke(PingCommand $command)\n    {\n        return time();\n    }\n}\n\n````\n\nYou can use `InFw\\TacticianAdapter\\Action\\AbstractAction` as base action.\n\n````php\n\u003c?php\n\nnamespace App\\Action;\n\nuse App\\Command\\PingCommand;\nuse Laminas\\Diactoros\\Response\\JsonResponse;\nuse Psr\\Http\\Message\\ResponseInterface;\nuse Psr\\Http\\Server\\RequestHandlerInterface;\nuse Psr\\Http\\Message\\ServerRequestInterface;\n\nclass PingAction implements RequestHandlerInterface\n{\n    public function handle(ServerRequestInterface $request): ResponseInterface\n    {\n        return new JsonResponse(['ack' =\u003e $this-\u003ebus-\u003ehandle(new PingCommand())]);\n    }\n}\n````\n\n## Modify Command Bus\n\nYou can modify the entire command bus to meet the needs of your project.\n\nThis is default config.\n\n````php\n\u003c?php\n// command-bus.global.php\n\nreturn [\n    ...,\n    'command_bus' =\u003e [\n        'locator' =\u003e \\League\\Tactician\\Handler\\Locator\\HandlerLocator::class,\n        'inflector' =\u003e \\League\\Tactician\\Handler\\MethodNameInflector\\MethodNameInflector::class,\n        'extractor' =\u003e \\League\\Tactician\\Handler\\CommandNameExtractor\\CommandNameExtractor::class,\n        'middleware' =\u003e [\n            \\League\\Tactician\\Plugins\\LockingMiddleware::class,\n            \\League\\Tactician\\Logger\\LoggerMiddleware::class,\n            \\League\\Tactician\\CommandEvents\\EventMiddleware::class,\n\n        ],\n    ],\n];\n````\n\n## Query Bus\n\nYou can use a query bus too, the difference with the command bus is that the query bus will always return an object.\n\n```php\n\u003c?php\n// command-bus.global.php\n\nreturn [\n    ...,\n    'query_bus' =\u003e [\n        'locator' =\u003e 'query_bus.handler_locator',\n        'inflector' =\u003e \\League\\Tactician\\Handler\\MethodNameInflector\\MethodNameInflector::class,\n        'extractor' =\u003e \\League\\Tactician\\Handler\\CommandNameExtractor\\CommandNameExtractor::class,\n        'middleware' =\u003e [\n\n        ],\n    ],\n];\n```\n\n[ico-version]: https://img.shields.io/packagist/v/antidot-fw/tactician.svg?style=flat-square\n[ico-license]: https://img.shields.io/badge/license-BSD%202--Clause-brightgreen.svg?style=flat-square\n[ico-travis]: https://img.shields.io/scrutinizer/build/g/antidot-framework/tactician-adapter.svg?style=flat-square\n[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/antidot-framework/tactician-adapter.svg?style=flat-square\n[ico-code-quality]: https://img.shields.io/scrutinizer/g/antidot-framework/tactician-adapter.svg?style=flat-square\n[ico-downloads]: https://img.shields.io/packagist/dt/antidot-fw/tactician.svg?style=flat-square\n\n[link-packagist]: https://packagist.org/packages/antidot-fw/tactician\n[link-travis]: https://scrutinizer-ci.com/g/antidot-framework/tactician-adapter/\n[link-scrutinizer]: https://scrutinizer-ci.com/g/antidot-framework/tactician-adapter/code-structure\n[link-code-quality]: https://scrutinizer-ci.com/g/antidot-framework/tactician-adapter/badges/coverage.png?b=master\n[link-downloads]: https://packagist.org/packages/antidot-fw/tactician\n[link-author]: https://github.com/kpicaza\n[link-contributors]: ../../contributors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantidot-framework%2Ftactician-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantidot-framework%2Ftactician-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantidot-framework%2Ftactician-adapter/lists"}