phariscope / event-store
开发事件存储,此包是起始基础。
1.1.1
2024-03-04 16:00 UTC
Requires
- php: >=8.1
- phariscope/event: ^1.1
- symfony/serializer: ^6.0 || ^7.0
Requires (Dev)
- infection/extension-installer: 0.1.2
- infection/infection: ^0.27
- phpstan/phpdoc-parser: ^1.20
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10
- squizlabs/php_codesniffer: 3.*
README
composer require phariscope/event-store
用法
此包没有直接用法。您只有想开发自己的事件存储组件时才应使用此包。
开发自己的存储
- 创建一个实现了 StoreInterface 的自己的 Store。
- 通过扩展 PersistEventSubscriberAbstract 创建自己的订阅者,它可以与您的存储一起构造。
StoreInterface 的一个示例与 StoreEventInMemory 一起提供。您可以用它进行测试。
为 pharsicope/Event 贡献
要求
- docker
- git
安装
- git clone git@github.com:phariscope/EventStore.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'