{"id":18358744,"url":"https://github.com/phmlabs/annovent","last_synced_at":"2025-07-05T14:38:40.642Z","repository":{"id":57039016,"uuid":"1438570","full_name":"phmLabs/Annovent","owner":"phmLabs","description":"Simple lightweight event dispatcher using annotations for registering listeners.","archived":false,"fork":false,"pushed_at":"2019-05-05T17:11:40.000Z","size":54,"stargazers_count":11,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-27T19:08:04.182Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.phmlabs.com/annovent","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/phmLabs.png","metadata":{"files":{"readme":"README.markdown","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":"2011-03-04T08:16:38.000Z","updated_at":"2022-02-23T15:39:12.000Z","dependencies_parsed_at":"2022-08-23T23:31:04.325Z","dependency_job_id":null,"html_url":"https://github.com/phmLabs/Annovent","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/phmLabs/Annovent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phmLabs%2FAnnovent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phmLabs%2FAnnovent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phmLabs%2FAnnovent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phmLabs%2FAnnovent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phmLabs","download_url":"https://codeload.github.com/phmLabs/Annovent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phmLabs%2FAnnovent/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263756502,"owners_count":23506540,"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":[],"created_at":"2024-11-05T22:19:19.759Z","updated_at":"2025-07-05T14:38:40.600Z","avatar_url":"https://github.com/phmLabs.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Annovent\n\nAnnovent is a simple to use event dispatcher inspired by the symfony component event dispatching implementation. It tries to provide all the features symfony does with some useful extensions.\n\n##Simple Usage\n\nThe Annovent dispatcher can be used in a simple and standard way as you are used from symfony:\n\n```php\n$dispatcher = new Dispatcher();\n$dispatcher-\u003econnect('SomeComponent.Render', array($listener, 'Method1'));\n$dispatcher-\u003enotify(new Event('SomeComponent.Render', array('foo' =\u003e 'bar'));\n```\n\n##Namespace\n\nAn extra feature of this event dispatcher is the so called namespacing. It is possible to register a lister to a complete set events belonging to a special namespace.\n\n```php\n$dispatcher-\u003econnect('SomeComponent.*', array($listener, 'Method1'));\n$dispatcher-\u003econnect('*', array($listener, 'Method2'));\n```\n\nThe first listener will be notified whenever a event is fired that starts with SomeComponent. The second one will always be notified.\n\n##Annotation\n\nConnection a listener to a special event is not limited to the connect method. It is also possible to register a listener using annotation (see doctrine common). \n\n```php\n\nclass Listener\n{\n  /**\n   * @Event(\"SomeComponent.Render\")\n   */\n  public function method1(Event $event)\n  {\n  }\n}\n\n$dispatcher-\u003econnectListener( new Listener );\n```\n\nUsing the connectListener method it is possible to connect a bunch of callbacks at once. \n\n##Named Parameters\n\nIf desired the event dispatcher can be used with named parameters.\n\n```php\nclass Listener2\n{\n  /**\n   * @Event(\"SomeComponent.Render\")\n   */\n  public function method1($argument1, $foo)\n  {\n  }\n}\n$dispatcher-\u003enotify(new Event('SomeComponent.Render', array('foo' =\u003e 'bar', 'argument1' =\u003e 'arg1' ));\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphmlabs%2Fannovent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphmlabs%2Fannovent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphmlabs%2Fannovent/lists"}