phariscope / event-store-doctrine
Store event via Doctrine
1.1.2
2024-03-12 08:08 UTC
Requires
- php: >=8.2
- doctrine/orm: ^2.16|^3
- phariscope/event-store: ^1.1
- symfony/cache: ^6.0|^6.3|^7
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-store
Usage
- First, make sure to have the DATABASE_URL environment variable correctly initialized.
- Second, add the PersistEventSubscriber to the listeners as soon as you want.
Enjoy, and observe an 'events' table that contains all published events.
// Assume env var is intiailized. // Example DATABASE_URL=mysql://root:pwd1234@mariadb:3306/ap-prod?serverVersion=mariadb-10.9.3&charset=utf8mb4 $store = new EventStoreDoctrine(); $subscriber = new PersistDoctrineEventSubscriber($store); EventPublisher::instance()->subscribe($subscriber); // use your own EventPublisherFacade could be a good idea
To Contribut to pharsicope/EventStoreDoctrine
Requirements
- docker
- git
Install
- git clone git@github.com:phariscope/EventStoreDoctrine.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 100%
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