{"id":22656869,"url":"https://github.com/libreworks/caridea-event","last_synced_at":"2025-03-29T08:11:17.563Z","repository":{"id":33173236,"uuid":"36814367","full_name":"libreworks/caridea-event","owner":"libreworks","description":":fried_shrimp: Caridea is a miniscule PHP application library. This is a shrimpy event component.","archived":false,"fork":false,"pushed_at":"2018-01-06T20:49:04.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-03T23:06:11.207Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libreworks.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":"2015-06-03T15:55:40.000Z","updated_at":"2016-11-17T19:51:56.000Z","dependencies_parsed_at":"2022-08-17T18:35:22.903Z","dependency_job_id":null,"html_url":"https://github.com/libreworks/caridea-event","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libreworks%2Fcaridea-event","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libreworks%2Fcaridea-event/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libreworks%2Fcaridea-event/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libreworks%2Fcaridea-event/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libreworks","download_url":"https://codeload.github.com/libreworks/caridea-event/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246156419,"owners_count":20732397,"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-12-09T10:16:45.596Z","updated_at":"2025-03-29T08:11:17.540Z","avatar_url":"https://github.com/libreworks.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# caridea-event\nCaridea is a miniscule PHP application library. This shrimpy fellow is what you'd use when you just want some helping hands and not a full-blown framework.\n\n![](http://libreworks.com/caridea-100.png)\n\nThis is its event library. It has interfaces for Publisher and Listener, and an abstract class for Event.\n\nIf you'd like a concrete implementation of `Publisher`, try [caridea-container](https://github.com/libreworks/caridea-container).\n\n[![Packagist](https://img.shields.io/packagist/v/caridea/event.svg)](https://packagist.org/packages/caridea/event)\n[![Build Status](https://travis-ci.org/libreworks/caridea-event.svg)](https://travis-ci.org/libreworks/caridea-event)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/libreworks/caridea-event/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/libreworks/caridea-event/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/libreworks/caridea-event/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/libreworks/caridea-event/?branch=master)\n\n## Installation\n\nYou can install this library using Composer:\n\n```console\n$ composer require caridea/event\n```\n\n* The master branch (version 3.x) of this project requires PHP 7.1 and has no dependencies.\n* Version 2.x of this project requires PHP 7.0 and has no dependencies.\n* Version 1.x of this project requires PHP 5.5 and has no dependencies.\n\n## Compliance\n\nReleases of this library will conform to [Semantic Versioning](http://semver.org).\n\nOur code is intended to comply with [PSR-1](http://www.php-fig.org/psr/psr-1/), [PSR-2](http://www.php-fig.org/psr/psr-2/), and [PSR-4](http://www.php-fig.org/psr/psr-4/). If you find any issues related to standards compliance, please send a pull request!\n\n## Documentation\n\n* Head over to [Read the Docs](http://caridea-event.readthedocs.io/en/latest/)\n\n## Examples\n\nJust a few quick examples.\n\nLet's say you have defined these classes\n\n```php\nnamespace Acme\\Foo;\n\nclass CustomEvent extends \\Caridea\\Event\\Event\n{\n}\n\nclass CustomEventListener implements \\Caridea\\Event\\Listener\n{\n    public function notify(\\Caridea\\Event\\Event $event)\n    {\n        if ($event instanceof CustomEvent) {\n            // do something here\n        }\n    }\n}\n```\n\nA publisher can be invoked like this:\n\n```php\n// Here, we assume that $publisher implements a \\Caridea\\Event\\Publisher and that\n// We have somehow registered an \\Acme\\Foo\\CustomEventListener with it.\n$publisher-\u003epublish(new \\Acme\\Foo\\CustomEvent());\n// Our CustomEventListener has its -\u003enotify method invoked.\n```\n\nThere's a no-op implementation of `Publisher` available as `\\Caridea\\Event\\NullPublisher`.\n\n### PublisherAware\n\nFor classes which need the event publisher, you can make use of the `PublisherAware` interface, and optionally the `PublisherSetter` trait.\n\n```php\nclass MyClass implements \\Caridea\\Event\\PublisherAware\n{\n    use \\Caridea\\Event\\PublisherSetter;\n\n    public function __construct()\n    {\n        $this-\u003esetPublisher(new \\Caridea\\Event\\NullPublisher());\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibreworks%2Fcaridea-event","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibreworks%2Fcaridea-event","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibreworks%2Fcaridea-event/lists"}