{"id":15296358,"url":"https://github.com/deprecated-packages/symfonyeventdispatcher","last_synced_at":"2026-04-14T00:05:29.406Z","repository":{"id":57063861,"uuid":"76784050","full_name":"deprecated-packages/SymfonyEventDispatcher","owner":"deprecated-packages","description":"[DEPRECATED] Use this instead →","archived":false,"fork":false,"pushed_at":"2017-05-05T11:22:26.000Z","size":87,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T05:43:36.689Z","etag":null,"topics":["event-dispatcher","events","nette","php71","symfony","symplify"],"latest_commit_sha":null,"homepage":"https://github.com/contributte/event-dispatcher","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deprecated-packages.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-18T13:17:40.000Z","updated_at":"2017-05-17T17:46:33.000Z","dependencies_parsed_at":"2022-08-24T10:10:23.304Z","dependency_job_id":null,"html_url":"https://github.com/deprecated-packages/SymfonyEventDispatcher","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deprecated-packages%2FSymfonyEventDispatcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deprecated-packages%2FSymfonyEventDispatcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deprecated-packages%2FSymfonyEventDispatcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deprecated-packages%2FSymfonyEventDispatcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deprecated-packages","download_url":"https://codeload.github.com/deprecated-packages/SymfonyEventDispatcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245407755,"owners_count":20610232,"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":["event-dispatcher","events","nette","php71","symfony","symplify"],"created_at":"2024-09-30T18:10:12.774Z","updated_at":"2026-04-14T00:05:29.368Z","avatar_url":"https://github.com/deprecated-packages.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The Simplest [Symfony Event Dispatcher](http://symfony.com/doc/current/components/event_dispatcher.html) integration to Nette\n\n[![Build Status](https://img.shields.io/travis/Symplify/SymfonyEventDispatcher/master.svg?style=flat-square)](https://travis-ci.org/Symplify/SymfonyEventDispatcher)\n[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/Symplify/SymfonyEventDispatcher.svg?style=flat-square)](https://scrutinizer-ci.com/g/Symplify/SymfonyEventDispatcher)\n[![Downloads](https://img.shields.io/packagist/dt/symplify/symfony-event-dispatcher.svg?style=flat-square)](https://packagist.org/packages/symplify/symfony-event-dispatcher)\n\n\n## Install\n\n```sh\ncomposer require symplify/symfony-event-dispatcher\n```\n\nRegister the extension in `config.neon`:\n\n```yaml\n# app/config/config.neon\n\nextensions:\n\t- Symplify\\SymfonyEventDispatcher\\Adapter\\Nette\\DI\\SymfonyEventDispatcherExtension\n```\n\n\n## Usage\n\nSee [short article about EventDispatcher](http://pehapkari.cz/blog/2016/12/05/symfony-event-dispatcher).\n**This article is tested** \u0026ndash; it will be still up-to-date with Symfony 4+. \n\n\n### 1. Create class that implements `Symfony\\Component\\EventDispatcher\\SubscriberInterface`:\n\n```php\n// app/EventSubscriber/CheckRequestEventSubscriber.php\n\nnamespace App\\EventSubscriber;\n\nuse Symfony\\Component\\EventDispatcher\\EventSubscriberInterface;\nuse Symfony\\Component\\HttpKernel\\KernelEvents;\nuse Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent\n\nfinal class CheckRequestEventSubscriber implements EventSubscriberInterface\n{\n    /**\n     * @var bool\n     */\n    public $isUserNotified = false;\n\n    public static function getSubscribedEvents(): array\n    {\n        // in format ['event name' =\u003e 'public function name that will be called']\n        return [KernelEvents::REQUEST =\u003e 'validateRequest'];\n    }\n\n\n    // Appropriate event object is passed in arguments\n    public function validateRequest(GetResponseEvent $event): void\n    {\n        // some logic to send notification\n        $this-\u003eisUserNotified = true;\n    }\n}\n```\n\n### 2. Register it to services\n\n```yaml\n# app/config/config.neon\n\nservices:\n    - App\\EventSubscriber\\CheckRequestEventSubscriber\n```\n\nAnd it works :)\n\nThat's all!\n\n\n## Contributing\n\nSend [issue](https://github.com/Symplify/Symplify/issues) or [pull-request](https://github.com/Symplify/Symplify/pulls) to main repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeprecated-packages%2Fsymfonyeventdispatcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeprecated-packages%2Fsymfonyeventdispatcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeprecated-packages%2Fsymfonyeventdispatcher/lists"}