phariscope / event
To implement events in domain driven developement or anyother styles projects with PHP
Installs: 1 493
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Requires
- php: >=8.1
Requires (Dev)
- infection/extension-installer: 0.1.2
- infection/infection: ^0.27
- phpstan/phpdoc-parser: ^1.20
- phpstan/phpstan: 1.10.15
- phpunit/phpunit: ^10
- squizlabs/php_codesniffer: 3.*
README
composer require phariscope/event
Usage
Steps are:
- Create a domain event (name + past tense verb, example:
AccountCreated
extendsEventAbstract
). - Publish this event.
- Distribute events.
Somewhere else:
- create a subscriber at an event (exemple: class SendEmailWhenAccountCreatedSubscriber implements EventSubscriber)
- register the subscriber, when event will be distrute the subscriber will handle it and do what it has to do
To Contribut to pharsicope/Event
Requirements
- docker
- git
Install
- git clone git@github.com:phariscope/Event.git
Unit test
bin/phpunit
Using Test-Driven Development (TDD) principles (thanks to Kent Beck and others), following good practices (thanks to Uncle Bob and others) and the great book 'DDD in PHP' by C. Buenosvinos, C. Soronellas, K. Akbary
Quality
- phpcs PSR12
- phpstan level 9
- coverage 100%
- infection MSI >99%
Quick check with:
./codecheck
Check coverage with:
bin/phpunit --coverage-html var
and view 'var/index.html' with your browser
Check infection with:
bin/infection
and view 'var/infection.html' with your browser