-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07c7237
commit 1bdb026
Showing
23 changed files
with
4,467 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/var/ | ||
/vendor/ | ||
/.phpunit.cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,57 @@ | ||
# Installation | ||
|
||
composer require ddd/event | ||
composer require ddd/event | ||
|
||
# Usage | ||
|
||
Steps are: | ||
* create a domain event (name + past tense verb, example: AccountCreated implements DomainEventInterface) | ||
* publish this event | ||
* distribute events | ||
|
||
Somewhere else: | ||
* create a subscriber at an event (exemple: class SendEmailWhenAccountCreatedSubscriber implements DomainEventSubscriber) | ||
* register the subscriber, when event will be distrute the subscriber will handle it and do what it has to do | ||
|
||
# To Contribut to ddd/Event | ||
|
||
## Requirements | ||
|
||
* docker | ||
* git | ||
|
||
## Install | ||
|
||
* git clone [email protected]:frederic100/event.git | ||
|
||
## Unit test | ||
|
||
```console | ||
bin/phpunit | ||
``` | ||
|
||
with Test Developpment Driven (thanks Kent Beck and the others), good practices (thanks R.Martin and the others) | ||
|
||
## Quality | ||
|
||
* phpcs STD12 | ||
* phpstan level 9 | ||
* coverage 100% | ||
* infection MSI >99% | ||
|
||
Quick check with: | ||
```console | ||
./codecheck | ||
``` | ||
|
||
Check coverage with: | ||
```console | ||
bin/phpunit --coverage-html var | ||
``` | ||
and view 'var/index.html' with your browser | ||
|
||
Check infection with: | ||
```console | ||
bin/infection | ||
``` | ||
and view 'var/infection.html' with your browser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
echo ${COMPOSER_HOME:-$HOME/.composer} | ||
if [ -t 0 ] ; then | ||
moinsit='-it' | ||
else | ||
moinsit='' | ||
fi | ||
docker run ${moinsit} --rm \ | ||
--volume $PWD:/app \ | ||
--user 1000:1000 \ | ||
-ti \ | ||
--name composer-running-script \ | ||
-v "$PWD":/usr/src \ | ||
composer-nextsign composer $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM composer:2.5.5 | ||
|
||
# Install necessary dependencies | ||
RUN apk update \ | ||
&& apk add --no-cache \ | ||
git \ | ||
unzip \ | ||
rabbitmq-c-dev \ | ||
g++ \ | ||
make \ | ||
autoconf | ||
|
||
# Install the PHP AMQP extension | ||
RUN pecl install amqp \ | ||
&& docker-php-ext-enable amqp | ||
|
||
WORKDIR /usr/src | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM php:8.2.10-fpm | ||
|
||
# Installation de l'extension pecl pcov | ||
RUN pecl install pcov \ | ||
&& docker-php-ext-enable pcov | ||
|
||
COPY ./php.ini $PHP_INI_DIR/php.ini | ||
|
||
WORKDIR /usr/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
date.timezone=Europe/Paris | ||
memory_limit=-1 | ||
phar.readonly=0 | ||
pcov.enabled=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
bin/php vendor/bin/infection --threads=$(nproc) $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
|
||
docker run \ | ||
--init \ | ||
--rm \ | ||
-ti \ | ||
--name php-ddd-event-running-script \ | ||
-v "$(pwd)/bin/docker/php/php.ini:/usr/local/etc/php/php.ini" \ | ||
-v "$PWD":"$PWD" \ | ||
--user 1000:1000 \ | ||
-w "$PWD" \ | ||
php-ddd-event php $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
bin/php vendor/bin/phpunit $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
#bin/local-php-security-checker composer.lock | ||
|
||
bin/php vendor/bin/phpcbf --standard=PSR12 ./src ./tests | ||
bin/php vendor/bin/phpcs --standard=PSR12 ./src ./tests | ||
|
||
bin/php vendor/bin/phpstan analyse --level=9 ./src | ||
bin/php vendor/bin/phpstan analyse --level=9 ./tests | ||
|
||
bin/phpunit --testsuite all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"name": "dddphp/event", | ||
"type": "library", | ||
"description": "To implement events in domain driven developement or anyother styles projects with PHP", | ||
"keywords": ["templating"], | ||
"homepage": "https://github.com/frederic100/event", | ||
"license": "BSD-3-Clause", | ||
"minimum-stability": "dev", | ||
"authors": [ | ||
{ | ||
"name": "Frédéric Royet", | ||
"email": "[email protected]", | ||
"homepage": "https://www.linkedin.com/in/frederic-royet-42568566/", | ||
"role": "Project Founder" | ||
} | ||
], | ||
"require": { | ||
"php": ">=7.2.5" | ||
}, | ||
"require-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.*" | ||
}, | ||
"autoload": { | ||
"psr-4" : { | ||
"Ddd\\Event\\" : "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4" : { | ||
"Ddd\\Event\\Tests\\" : "tests/" | ||
} | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"infection/extension-installer": true | ||
} | ||
} | ||
} |
Oops, something went wrong.