{"id":15525355,"url":"https://github.com/ghostwriter/event-dispatcher","last_synced_at":"2026-04-14T18:01:02.242Z","repository":{"id":37797519,"uuid":"431529170","full_name":"ghostwriter/event-dispatcher","owner":"ghostwriter","description":"Event Dispatcher implementation.","archived":false,"fork":false,"pushed_at":"2026-04-10T18:49:42.000Z","size":84903,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"6.0.x","last_synced_at":"2026-04-10T20:26:16.074Z","etag":null,"topics":["event-dispatcher","ghostwriter"],"latest_commit_sha":null,"homepage":"https://github.com/ghostwriter/event-dispatcher","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ghostwriter.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["ghostwriter"]}},"created_at":"2021-11-24T15:08:50.000Z","updated_at":"2026-04-10T18:49:15.000Z","dependencies_parsed_at":"2023-02-10T08:03:05.953Z","dependency_job_id":"70f51a95-af28-4257-b412-4d99a3826541","html_url":"https://github.com/ghostwriter/event-dispatcher","commit_stats":{"total_commits":240,"total_committers":1,"mean_commits":240.0,"dds":0.0,"last_synced_commit":"c304658c9cac305f97d52a3955a53719afabe8a1"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/ghostwriter/event-dispatcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostwriter%2Fevent-dispatcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostwriter%2Fevent-dispatcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostwriter%2Fevent-dispatcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostwriter%2Fevent-dispatcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghostwriter","download_url":"https://codeload.github.com/ghostwriter/event-dispatcher/tar.gz/refs/heads/6.0.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostwriter%2Fevent-dispatcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31808518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T11:13:53.975Z","status":"ssl_error","status_checked_at":"2026-04-14T11:13:53.299Z","response_time":153,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["event-dispatcher","ghostwriter"],"created_at":"2024-10-02T10:57:02.212Z","updated_at":"2026-04-14T18:01:02.232Z","avatar_url":"https://github.com/ghostwriter.png","language":"PHP","funding_links":["https://github.com/sponsors/ghostwriter"],"categories":[],"sub_categories":[],"readme":"# Event Dispatcher\n\n[![GitHub Sponsors](https://img.shields.io/github/sponsors/ghostwriter?label=Sponsor+@ghostwriter/event-dispatcher\u0026logo=GitHub+Sponsors)](https://github.com/sponsors/ghostwriter)\n[![Automation](https://github.com/ghostwriter/event-dispatcher/actions/workflows/automation.yml/badge.svg)](https://github.com/ghostwriter/event-dispatcher/actions/workflows/automation.yml)\n[![Supported PHP Version](https://badgen.net/packagist/php/ghostwriter/event-dispatcher?color=8892bf)](https://www.php.net/supported-versions)\n[![Downloads](https://badgen.net/packagist/dt/ghostwriter/event-dispatcher?color=blue)](https://packagist.org/packages/ghostwriter/event-dispatcher)\n\nProvides an Event Dispatcher implementation for PHP.\n\n## Installation\n\nYou can install the package via composer:\n\n``` bash\ncomposer require ghostwriter/event-dispatcher\n```\n\n### Star ⭐️ this repo if you find it useful\n\nYou can also star (🌟) this repo to find it easier later.\n\n### Usage\n\nRegistering and dispatching an Event Listener.\n\n```php\nuse Ghostwriter\\EventDispatcher\\EventDispatcher;\nuse Ghostwriter\\EventDispatcher\\ListenerProvider;\n\n// Create an event class\nfinal class ExampleEvent\n{\n}\n\n// Create an Event Listener\nfinal class ExampleEventListener\n{\n    public function __invoke(ExampleEvent $event): void\n    {\n        // Handle the event, e.g., print the event class name\n        // echo $event::class;\n    }\n}\n\n// Create a ListenerProvider\n$listenerProvider = ListenerProvider::new(); // or new ListenerProvider(Container::getInstance())\n\n// Bind the Listener to the Event\n$listenerProvider-\u003elisten(ExampleEvent::class, ExampleEventListener::class);\n\n// Create an EventDispatcher\n$dispatcher = EventDispatcher::new($listenerProvider); // or new EventDispatcher($listenerProvider)\n\n// Dispatch the Event.\n$event = $dispatcher-\u003edispatch(new ExampleEvent());\n\n// Assert the Event is the same as the dispatched Event\nassert($event instanceof ExampleEvent);\n``` \n\n### Changelog\n\nPlease see [CHANGELOG.md](./CHANGELOG.md) for more information what has changed recently.\n\n### Security\n\nIf you discover any security related issues, please email `nathanael.esayeas@protonmail.com` or create a [Security Advisory](https://github.com/ghostwriter/event-dispatcher/security/advisories/new) instead of using the issue tracker.\n\n## License\n\nThe BSD-3-Clause. Please see [License File](./LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostwriter%2Fevent-dispatcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghostwriter%2Fevent-dispatcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostwriter%2Fevent-dispatcher/lists"}