{"id":26581603,"url":"https://github.com/awd-studio/command-bus","last_synced_at":"2025-08-05T23:32:23.248Z","repository":{"id":62490151,"uuid":"178628366","full_name":"awd-studio/command-bus","owner":"awd-studio","description":"A very simple implementation of the Command bus pattern on PHP","archived":false,"fork":false,"pushed_at":"2019-03-31T01:12:58.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T07:33:21.281Z","etag":null,"topics":["command-bus"],"latest_commit_sha":null,"homepage":"https://github.com/awd-studio/command-bus","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/awd-studio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-31T01:12:54.000Z","updated_at":"2019-03-31T01:17:37.000Z","dependencies_parsed_at":"2022-11-02T09:31:24.433Z","dependency_job_id":null,"html_url":"https://github.com/awd-studio/command-bus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/awd-studio/command-bus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awd-studio%2Fcommand-bus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awd-studio%2Fcommand-bus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awd-studio%2Fcommand-bus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awd-studio%2Fcommand-bus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/awd-studio","download_url":"https://codeload.github.com/awd-studio/command-bus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awd-studio%2Fcommand-bus/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268992563,"owners_count":24341547,"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","status":"online","status_checked_at":"2025-08-05T02:00:12.334Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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"],"created_at":"2025-03-23T07:30:44.946Z","updated_at":"2025-08-05T23:32:23.184Z","avatar_url":"https://github.com/awd-studio.png","language":"PHP","readme":"# AWD Command Bus\n\nProvides a simple implementation of the Command bus pattern.\n\n### Install\n```bash\ncomposer require awd-studio/command-bus\n```\n\n### Usage\n\n- Implement a `\\AwdStudio\\CommandBus\\Handler\\HandlersCollection` (or use a defined one - `\\AwdStudio\\CommandBus\\Simple\\ArrayCollection`)\n- Register there all off handlers (must implement `AwdStudio\\CommandBus\\Handler\\CommandHandler` interface)\n- And then - you'll be able to use the bus (`AwdStudio\\CommandBus\\CommandBus`):\n```php\n\u003c?php\n\nuse \\AwdStudio\\CommandBus\\CommandBus;\nuse \\AwdStudio\\CommandBus\\Simple\\ArrayCollection;\n\n// Creating the handlers collection\n$handlers = new ArrayCollection();\n\n// Fill it with handlers\n$handlers-\u003eadd(new MyCommandAHandler());\n$handlers-\u003eadd(new MyCommandBHandler());\n\n// Remove handlers, if it's required\n$handlers-\u003eremove(new MyCommandCHandler());\n\n// Creating the bus\n$bus = new CommandBus($handlers);\n\n// Handle commands\n$bus-\u003ehandle(new MyCommandA());\n$bus-\u003ehandle(new MyCommandB());\n```\n\n### Testing\n\nTo run tests - execute next script:\n```bash\ncomposer test\n# or with coverage\ncomposer coverage\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawd-studio%2Fcommand-bus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawd-studio%2Fcommand-bus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawd-studio%2Fcommand-bus/lists"}