phariscope / event-store-doctrine
通过 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
使用方法
- 首先,请确保正确初始化了 DATABASE_URL 环境变量。
- 其次,在需要时尽快将 PersistEventSubscriber 添加到监听器中。
享受使用,并观察包含所有已发布事件的 '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
为 phariscope/EventStoreDoctrine 贡献
要求
- docker
- git
安装
- git clone git@github.com:phariscope/EventStoreDoctrine.git
单元测试
bin/phpunit
遵循测试驱动开发 (TDD) 原则(感谢 Kent Beck 和其他人),遵循良好的实践(感谢 Uncle Bob 和其他人),以及 C. Buenosvinos,C. Soronellas,K. Akbary 所著的《PHP中的DDD》一书
质量
- phpcs PSR12
- phpstan 级别 9
- 覆盖率 100%
- infection MSI 100%
快速检查
./codecheck
使用以下命令检查覆盖率
bin/phpunit --coverage-html var
并使用您的浏览器查看 'var/index.html'
使用以下命令检查 infection
bin/infection
并使用您的浏览器查看 'var/infection.html'