Initial commit
This commit is contained in:
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
/.php-cs-fixer.cache
|
||||||
|
/vendor
|
||||||
|
/build
|
||||||
|
/composer.lock
|
||||||
|
/auth.json
|
||||||
|
/.phpunit.result.cache
|
||||||
61
.php-cs-fixer.dist.php
Normal file
61
.php-cs-fixer.dist.php
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
$header = <<<'HEADER'
|
||||||
|
This file is part of the zapoyok.info project.
|
||||||
|
(c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
|
||||||
|
For the full copyright and license information, please view the LICENSE
|
||||||
|
file that was distributed with this source code.
|
||||||
|
HEADER;
|
||||||
|
|
||||||
|
$finder = PhpCsFixer\Finder::create()
|
||||||
|
->in('src/')
|
||||||
|
->in('tests/')
|
||||||
|
;
|
||||||
|
|
||||||
|
$config = new PhpCsFixer\Config();
|
||||||
|
|
||||||
|
return $config
|
||||||
|
->setRiskyAllowed(true)
|
||||||
|
->setRules([
|
||||||
|
'header_comment' => ['header' => $header, 'comment_type' => 'PHPDoc', 'location' => 'after_declare_strict'],
|
||||||
|
'@PHP71Migration' => true,
|
||||||
|
'@PHP71Migration:risky' => true,
|
||||||
|
'@PHP73Migration' => true,
|
||||||
|
'@PhpCsFixer' => true,
|
||||||
|
'@Symfony' => true,
|
||||||
|
'@Symfony:risky' => true,
|
||||||
|
'@DoctrineAnnotation' => true,
|
||||||
|
'array_syntax' => ['syntax' => 'short'],
|
||||||
|
'general_phpdoc_annotation_remove' => ['annotations' => ['author', 'package', 'subpackage']],
|
||||||
|
'no_useless_return' => true,
|
||||||
|
'phpdoc_to_comment' => false,
|
||||||
|
'method_chaining_indentation' => false,
|
||||||
|
'indentation_type' => true,
|
||||||
|
'ordered_imports' => true,
|
||||||
|
'line_ending' => true,
|
||||||
|
'no_superfluous_phpdoc_tags' => true,
|
||||||
|
'concat_space' => ['spacing' => 'one'],
|
||||||
|
'class_definition' => [
|
||||||
|
'multi_line_extends_each_single_line' => true,
|
||||||
|
'single_item_single_line' => false,
|
||||||
|
'single_line' => false,
|
||||||
|
],
|
||||||
|
'php_unit_test_class_requires_covers' => false,
|
||||||
|
'phpdoc_order' => true,
|
||||||
|
'phpdoc_align' => ['align' => 'vertical'],
|
||||||
|
'self_accessor' => false,
|
||||||
|
])
|
||||||
|
->setUsingCache(true)
|
||||||
|
->setFinder($finder)
|
||||||
|
;
|
||||||
29
.yamllint
Normal file
29
.yamllint
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
ignore: |
|
||||||
|
vendor/
|
||||||
|
node_modules/
|
||||||
|
.github/
|
||||||
|
|
||||||
|
extends: default
|
||||||
|
|
||||||
|
rules:
|
||||||
|
comments: disable
|
||||||
|
comments-indentation: disable
|
||||||
|
document-start: disable
|
||||||
|
empty-lines:
|
||||||
|
max: 1
|
||||||
|
max-start: 0
|
||||||
|
max-end: 0
|
||||||
|
line-length: disable
|
||||||
|
truthy:
|
||||||
|
allowed-values: [ 'true', 'false' ]
|
||||||
|
check-keys: false
|
||||||
|
braces:
|
||||||
|
level: warning
|
||||||
|
max-spaces-inside: 1
|
||||||
|
brackets:
|
||||||
|
level: warning
|
||||||
|
max-spaces-inside: 1
|
||||||
|
indentation:
|
||||||
|
spaces: 2
|
||||||
|
indent-sequences: true
|
||||||
|
check-multi-line-strings: false
|
||||||
106
Makefile
Normal file
106
Makefile
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
all:
|
||||||
|
@echo "Please choose a task."
|
||||||
|
.PHONY: all
|
||||||
|
|
||||||
|
lint: lint-composer lint-yaml lint-xml lint-xliff lint-php
|
||||||
|
.PHONY: lint
|
||||||
|
|
||||||
|
lint-composer:
|
||||||
|
composer-normalize --dry-run
|
||||||
|
composer validate
|
||||||
|
.PHONY: lint-composer
|
||||||
|
|
||||||
|
lint-yaml:
|
||||||
|
yamllint .
|
||||||
|
|
||||||
|
.PHONY: lint-yaml
|
||||||
|
|
||||||
|
lint-xml:
|
||||||
|
find . -name '*.xml' \
|
||||||
|
-not -path './vendor/*' \
|
||||||
|
-not -path './src/Resources/public/vendor/*' \
|
||||||
|
-not -path './src/tests/data/*' \
|
||||||
|
| while read xmlFile; \
|
||||||
|
do \
|
||||||
|
XMLLINT_INDENT=' ' xmllint --encode UTF-8 --format "$$xmlFile"|diff - "$$xmlFile"; \
|
||||||
|
if [ $$? -ne 0 ] ;then exit 1; fi; \
|
||||||
|
done
|
||||||
|
|
||||||
|
.PHONY: lint-xml
|
||||||
|
|
||||||
|
lint-xliff:
|
||||||
|
find . -name '*.xlf' \
|
||||||
|
-not -path './vendor/*' \
|
||||||
|
-not -path './src/Resources/public/vendor/*' \
|
||||||
|
| while read xmlFile; \
|
||||||
|
do \
|
||||||
|
XMLLINT_INDENT=' ' xmllint --encode UTF-8 --format "$$xmlFile"|diff - "$$xmlFile"; \
|
||||||
|
if [ $$? -ne 0 ] ;then exit 1; fi; \
|
||||||
|
done
|
||||||
|
|
||||||
|
.PHONY: lint-xliff
|
||||||
|
|
||||||
|
lint-php:
|
||||||
|
vendor/bin/php-cs-fixer fix --verbose --diff --dry-run
|
||||||
|
.PHONY: lint-php
|
||||||
|
|
||||||
|
lint-symfony: lint-symfony-container lint-symfony-twig lint-symfony-xliff lint-symfony-yaml
|
||||||
|
.PHONY: lint-symfony
|
||||||
|
|
||||||
|
lint-symfony-container:
|
||||||
|
bin/console lint:container
|
||||||
|
.PHONY: lint-symfony-container
|
||||||
|
|
||||||
|
lint-symfony-twig:
|
||||||
|
bin/console lint:twig src tests
|
||||||
|
.PHONY: lint-symfony-twig
|
||||||
|
|
||||||
|
lint-symfony-xliff:
|
||||||
|
bin/console lint:xliff src tests
|
||||||
|
.PHONY: lint-symfony-xliff
|
||||||
|
|
||||||
|
lint-symfony-yaml:
|
||||||
|
bin/console lint:yaml src tests
|
||||||
|
.PHONY: lint-symfony-yaml
|
||||||
|
|
||||||
|
cs-fix: cs-fix-php cs-fix-xml cs-fix-xliff cs-fix-composer
|
||||||
|
.PHONY: cs-fix
|
||||||
|
|
||||||
|
cs-fix-php:
|
||||||
|
vendor/bin/php-cs-fixer fix --verbose
|
||||||
|
.PHONY: cs-fix-php
|
||||||
|
|
||||||
|
cs-fix-xml:
|
||||||
|
find . -name '*.xml' \
|
||||||
|
-not -path './vendor/*' \
|
||||||
|
-not -path './src/Resources/public/vendor/*' \
|
||||||
|
| while read xmlFile; \
|
||||||
|
do \
|
||||||
|
XMLLINT_INDENT=' ' xmllint --encode UTF-8 --format "$$xmlFile" --output "$$xmlFile"; \
|
||||||
|
done
|
||||||
|
.PHONY: cs-fix-xml
|
||||||
|
|
||||||
|
cs-fix-xliff:
|
||||||
|
find . -name '*.xlf' \
|
||||||
|
-not -path './vendor/*' \
|
||||||
|
-not -path './src/Resources/public/vendor/*' \
|
||||||
|
| while read xmlFile; \
|
||||||
|
do \
|
||||||
|
XMLLINT_INDENT=' ' xmllint --encode UTF-8 --format "$$xmlFile" --output "$$xmlFile"; \
|
||||||
|
done
|
||||||
|
.PHONY: cs-fix-xliff
|
||||||
|
|
||||||
|
cs-fix-composer:
|
||||||
|
composer-normalize
|
||||||
|
.PHONY: cs-fix-composer
|
||||||
|
|
||||||
|
build:
|
||||||
|
mkdir $@
|
||||||
|
|
||||||
|
test:
|
||||||
|
vendor/bin/phpunit -c phpunit.xml.dist
|
||||||
|
.PHONY: test
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover build/logs/clover.xml --dont-report-useless-tests
|
||||||
|
.PHONY: coverage
|
||||||
50
composer.json
Normal file
50
composer.json
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
{
|
||||||
|
"name": "zapoyok/cqrs-bundle",
|
||||||
|
"description": "CQRS bundle : interface, bus, Ids, ValueObject, .... ",
|
||||||
|
"license": "MIT",
|
||||||
|
"type": "library",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Jérôme Fix",
|
||||||
|
"email": "jerome.fix@zapoyok.info"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"require": {
|
||||||
|
"php": "^8.1",
|
||||||
|
"digital-craftsman/ids": "0.5.*",
|
||||||
|
"symfony/messenger": "^6.2",
|
||||||
|
"psr/clock": "^1.0.0",
|
||||||
|
"symfony/uid": "^6.2"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"dg/bypass-finals": "^1.4",
|
||||||
|
"friendsofphp/php-cs-fixer": "^3.12",
|
||||||
|
"phpunit/phpunit": "^9.5",
|
||||||
|
"zapoyok/phpunit-php": "@dev",
|
||||||
|
"symfony/phpunit-bridge": "^6.2"
|
||||||
|
},
|
||||||
|
"repositories": [
|
||||||
|
{
|
||||||
|
"type": "vcs",
|
||||||
|
"url": "https://gitlab.zapoyok.info/shared/phpunit-php.git"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Zapoyok\\CQRSBundle\\": "src"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload-dev": {
|
||||||
|
"psr-4": {
|
||||||
|
"Zapoyok\\Tests\\CQRSBundle\\": "tests"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.0.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "vendor/bin/phpunit -c phpunit.xml.dist"
|
||||||
|
}
|
||||||
|
}
|
||||||
30
phpunit.xml.dist
Normal file
30
phpunit.xml.dist
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<phpunit backupGlobals="false"
|
||||||
|
backupStaticAttributes="false"
|
||||||
|
colors="true"
|
||||||
|
failOnWarning="true"
|
||||||
|
failOnRisky="true"
|
||||||
|
stopOnFailure="false"
|
||||||
|
bootstrap="tests/bootstrap.php"
|
||||||
|
>
|
||||||
|
<coverage>
|
||||||
|
<include>
|
||||||
|
<directory>./src</directory>
|
||||||
|
</include>
|
||||||
|
</coverage>
|
||||||
|
|
||||||
|
<testsuites>
|
||||||
|
<testsuite name="CQRS">
|
||||||
|
<directory suffix="Test.php">./tests/</directory>
|
||||||
|
</testsuite>
|
||||||
|
</testsuites>
|
||||||
|
<php>
|
||||||
|
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0" />
|
||||||
|
</php>
|
||||||
|
|
||||||
|
<extensions>
|
||||||
|
<!-- @see https://tomasvotruba.com/blog/2019/03/28/how-to-mock-final-classes-in-phpunit/ -->
|
||||||
|
<extension class="Scc\PhpUnit\Hook\BypassFinalHook"/>
|
||||||
|
</extensions>
|
||||||
|
|
||||||
|
</phpunit>
|
||||||
17
src/Command/AsyncCommandInterface.php
Normal file
17
src/Command/AsyncCommandInterface.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\Command;
|
||||||
|
|
||||||
|
interface AsyncCommandInterface extends CommandInterface
|
||||||
|
{
|
||||||
|
}
|
||||||
18
src/Command/CommandBusInterface.php
Normal file
18
src/Command/CommandBusInterface.php
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\Command;
|
||||||
|
|
||||||
|
interface CommandBusInterface
|
||||||
|
{
|
||||||
|
public function dispatch(CommandInterface $command): void;
|
||||||
|
}
|
||||||
17
src/Command/CommandHandlerInterface.php
Normal file
17
src/Command/CommandHandlerInterface.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\Command;
|
||||||
|
|
||||||
|
interface CommandHandlerInterface
|
||||||
|
{
|
||||||
|
}
|
||||||
17
src/Command/CommandInterface.php
Normal file
17
src/Command/CommandInterface.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\Command;
|
||||||
|
|
||||||
|
interface CommandInterface
|
||||||
|
{
|
||||||
|
}
|
||||||
28
src/Command/CommandResponse.php
Normal file
28
src/Command/CommandResponse.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\Command;
|
||||||
|
|
||||||
|
use DigitalCraftsman\Ids\ValueObject\Id;
|
||||||
|
|
||||||
|
class CommandResponse
|
||||||
|
{
|
||||||
|
public Id $id;
|
||||||
|
|
||||||
|
public static function withValue(Id $id): CommandResponse
|
||||||
|
{
|
||||||
|
$response = new self();
|
||||||
|
$response->id = $id;
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
}
|
||||||
30
src/Command/MessengerCommandBus.php
Normal file
30
src/Command/MessengerCommandBus.php
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\Command;
|
||||||
|
|
||||||
|
use Symfony\Component\Messenger\MessageBusInterface;
|
||||||
|
|
||||||
|
final class MessengerCommandBus implements CommandBusInterface
|
||||||
|
{
|
||||||
|
private MessageBusInterface $commandBus;
|
||||||
|
|
||||||
|
public function __construct(MessageBusInterface $commandBus)
|
||||||
|
{
|
||||||
|
$this->commandBus = $commandBus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function dispatch(CommandInterface $command): void
|
||||||
|
{
|
||||||
|
$this->commandBus->dispatch($command);
|
||||||
|
}
|
||||||
|
}
|
||||||
17
src/Command/SyncCommandInterface.php
Normal file
17
src/Command/SyncCommandInterface.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\Command;
|
||||||
|
|
||||||
|
interface SyncCommandInterface extends CommandInterface
|
||||||
|
{
|
||||||
|
}
|
||||||
32
src/DependencyInjection/SccCQRSExtension.php
Normal file
32
src/DependencyInjection/SccCQRSExtension.php
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\DependencyInjection;
|
||||||
|
|
||||||
|
use Symfony\Component\Config\Definition\Processor;
|
||||||
|
use Symfony\Component\Config\FileLocator;
|
||||||
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
|
use Symfony\Component\DependencyInjection\Extension\Extension;
|
||||||
|
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
|
||||||
|
|
||||||
|
final class SccCQRSExtension extends Extension
|
||||||
|
{
|
||||||
|
public function load(array $configs, ContainerBuilder $container): void
|
||||||
|
{
|
||||||
|
$processor = new Processor();
|
||||||
|
// $configuration = new Configuration();
|
||||||
|
//
|
||||||
|
// $config = $processor->processConfiguration($configuration, $configs);
|
||||||
|
$loader = new PhpFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
|
||||||
|
$loader->load('services.php');
|
||||||
|
}
|
||||||
|
}
|
||||||
29
src/DomainModel/Clock/Clock.php
Normal file
29
src/DomainModel/Clock/Clock.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\DomainModel\Clock;
|
||||||
|
|
||||||
|
use Psr\Clock\ClockInterface;
|
||||||
|
|
||||||
|
final class Clock
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
private ClockInterface $clock,
|
||||||
|
) {
|
||||||
|
$this->clock = $clock->withTimeZone('UTC');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function now(): \DateTimeImmutable
|
||||||
|
{
|
||||||
|
return $this->clock->now();
|
||||||
|
}
|
||||||
|
}
|
||||||
17
src/DomainModel/DomainEventInterface.php
Normal file
17
src/DomainModel/DomainEventInterface.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\DomainModel;
|
||||||
|
|
||||||
|
interface DomainEventInterface
|
||||||
|
{
|
||||||
|
}
|
||||||
35
src/DomainModel/TriggerEventsTrait.php
Normal file
35
src/DomainModel/TriggerEventsTrait.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\DomainModel;
|
||||||
|
|
||||||
|
trait TriggerEventsTrait
|
||||||
|
{
|
||||||
|
/** @var DomainEventInterface[] */
|
||||||
|
private array $domainEvents = [];
|
||||||
|
|
||||||
|
/** @return DomainEventInterface[] */
|
||||||
|
public function domainEvents(): array
|
||||||
|
{
|
||||||
|
return $this->domainEvents;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function notifyDomainEvent(DomainEventInterface $domainEvent): void
|
||||||
|
{
|
||||||
|
$this->domainEvents[] = $domainEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function resetDomainEvent(): void
|
||||||
|
{
|
||||||
|
$this->domainEvents = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
23
src/Event/EventBusInterface.php
Normal file
23
src/Event/EventBusInterface.php
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\Event;
|
||||||
|
|
||||||
|
use Scc\CQRSBundle\DomainModel\DomainEventInterface;
|
||||||
|
|
||||||
|
interface EventBusInterface
|
||||||
|
{
|
||||||
|
public function notify(DomainEventInterface $event): void;
|
||||||
|
|
||||||
|
/** @param DomainEventInterface[] $domainEvents */
|
||||||
|
public function notifyAll(array $domainEvents): void;
|
||||||
|
}
|
||||||
17
src/Event/EventHandlerInterface.php
Normal file
17
src/Event/EventHandlerInterface.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\Event;
|
||||||
|
|
||||||
|
interface EventHandlerInterface
|
||||||
|
{
|
||||||
|
}
|
||||||
35
src/Event/MessengerEventBus.php
Normal file
35
src/Event/MessengerEventBus.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\Event;
|
||||||
|
|
||||||
|
use Scc\CQRSBundle\DomainModel\DomainEventInterface;
|
||||||
|
use Symfony\Component\Messenger\MessageBusInterface;
|
||||||
|
|
||||||
|
final class MessengerEventBus implements EventBusInterface
|
||||||
|
{
|
||||||
|
public function __construct(private MessageBusInterface $eventBus)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function notify(DomainEventInterface $event): void
|
||||||
|
{
|
||||||
|
$this->eventBus->dispatch($event);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function notifyAll(array $domainEvents): void
|
||||||
|
{
|
||||||
|
foreach ($domainEvents as $element) {
|
||||||
|
$this->notify($element);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
79
src/MessageId.php
Normal file
79
src/MessageId.php
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle;
|
||||||
|
|
||||||
|
use Symfony\Component\Uid\Uuid;
|
||||||
|
|
||||||
|
// snippet message-id
|
||||||
|
class MessageId
|
||||||
|
{
|
||||||
|
private string $value;
|
||||||
|
|
||||||
|
final private function __construct()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __toString()
|
||||||
|
{
|
||||||
|
return $this->value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @return static */
|
||||||
|
public static function fromUuidRfc4122AsString(string $uuidAsString): self
|
||||||
|
{
|
||||||
|
self::checkIsValidUuid($uuidAsString);
|
||||||
|
|
||||||
|
return (new static())
|
||||||
|
->setValue($uuidAsString)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @return static */
|
||||||
|
final public static function nextId(): self
|
||||||
|
{
|
||||||
|
return static::fromUuidRfc4122AsString(
|
||||||
|
Uuid::v4()->toRfc4122()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function equals(self $other): bool
|
||||||
|
{
|
||||||
|
return $this->value === $other->value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function toString(): string
|
||||||
|
{
|
||||||
|
return (string) $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function id(): Uuid
|
||||||
|
{
|
||||||
|
return Uuid::fromRfc4122($this->value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @return $this */
|
||||||
|
private function setValue(string $value): self
|
||||||
|
{
|
||||||
|
$this->value = $value;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function checkIsValidUuid(string $uuidAsString): void
|
||||||
|
{
|
||||||
|
if (!Uuid::isValid($uuidAsString)) {
|
||||||
|
throw new \InvalidArgumentException('The value does not represent a valid identifier based in Uuid');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// end-snippet
|
||||||
83
src/MessageTrait.php
Normal file
83
src/MessageTrait.php
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle;
|
||||||
|
|
||||||
|
// snippet message-trait
|
||||||
|
trait MessageTrait
|
||||||
|
{
|
||||||
|
protected ?MessageId $messageId = null;
|
||||||
|
protected ?MessageId $replyToId = null;
|
||||||
|
protected ?MessageId $correlationId = null;
|
||||||
|
|
||||||
|
public function stampIds(
|
||||||
|
?MessageId $messageId = null,
|
||||||
|
?MessageId $replyToId = null,
|
||||||
|
?MessageId $correlationId = null
|
||||||
|
): static {
|
||||||
|
$this->messageId = $messageId;
|
||||||
|
$this->replyToId = $replyToId;
|
||||||
|
$this->correlationId = $correlationId;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stampAsNewMessage(): static
|
||||||
|
{
|
||||||
|
$messageId = MessageId::nextId();
|
||||||
|
|
||||||
|
return $this->stampIds(
|
||||||
|
$messageId,
|
||||||
|
null,
|
||||||
|
$messageId,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stampAsResponse(
|
||||||
|
?MessageId $replyTo,
|
||||||
|
?MessageId $correlationId
|
||||||
|
): static {
|
||||||
|
return $this->stampIds(
|
||||||
|
MessageId::nextId(),
|
||||||
|
$replyTo,
|
||||||
|
$correlationId,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param MessageTrait $message
|
||||||
|
*/
|
||||||
|
public function stampAsResponseTo($message): static
|
||||||
|
{
|
||||||
|
return $this->stampIds(
|
||||||
|
MessageId::nextId(),
|
||||||
|
$message->messageId(),
|
||||||
|
$message->messageCorrelationId()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function messageId(): ?MessageId
|
||||||
|
{
|
||||||
|
return $this->messageId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function messageReplyId(): ?MessageId
|
||||||
|
{
|
||||||
|
return $this->replyToId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function messageCorrelationId(): ?MessageId
|
||||||
|
{
|
||||||
|
return $this->correlationId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// end-snippet
|
||||||
27
src/Projection/MessengerProjectionBus.php
Normal file
27
src/Projection/MessengerProjectionBus.php
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\Projection;
|
||||||
|
|
||||||
|
use Symfony\Component\Messenger\MessageBusInterface;
|
||||||
|
|
||||||
|
final class MessengerProjectionBus implements ProjectionBusInterface
|
||||||
|
{
|
||||||
|
public function __construct(private MessageBusInterface $projectionBus)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function project(ProjectionInterface $projection): void
|
||||||
|
{
|
||||||
|
$this->projectionBus->dispatch($projection);
|
||||||
|
}
|
||||||
|
}
|
||||||
18
src/Projection/ProjectionBusInterface.php
Normal file
18
src/Projection/ProjectionBusInterface.php
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\Projection;
|
||||||
|
|
||||||
|
interface ProjectionBusInterface
|
||||||
|
{
|
||||||
|
public function project(ProjectionInterface $projection): void;
|
||||||
|
}
|
||||||
17
src/Projection/ProjectionHandlerInterface.php
Normal file
17
src/Projection/ProjectionHandlerInterface.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\Projection;
|
||||||
|
|
||||||
|
interface ProjectionHandlerInterface
|
||||||
|
{
|
||||||
|
}
|
||||||
17
src/Projection/ProjectionInterface.php
Normal file
17
src/Projection/ProjectionInterface.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\Projection;
|
||||||
|
|
||||||
|
interface ProjectionInterface
|
||||||
|
{
|
||||||
|
}
|
||||||
33
src/Query/MessengerQueryBus.php
Normal file
33
src/Query/MessengerQueryBus.php
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\Query;
|
||||||
|
|
||||||
|
use Symfony\Component\Messenger\HandleTrait;
|
||||||
|
use Symfony\Component\Messenger\MessageBusInterface;
|
||||||
|
|
||||||
|
final class MessengerQueryBus implements QueryBusInterface
|
||||||
|
{
|
||||||
|
use HandleTrait {
|
||||||
|
handle as handleQuery;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __construct(MessageBusInterface $queryBus)
|
||||||
|
{
|
||||||
|
$this->messageBus = $queryBus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function ask(QueryInterface $query): mixed
|
||||||
|
{
|
||||||
|
return $this->handleQuery($query);
|
||||||
|
}
|
||||||
|
}
|
||||||
18
src/Query/QueryBusInterface.php
Normal file
18
src/Query/QueryBusInterface.php
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\Query;
|
||||||
|
|
||||||
|
interface QueryBusInterface
|
||||||
|
{
|
||||||
|
public function ask(QueryInterface $query): mixed;
|
||||||
|
}
|
||||||
17
src/Query/QueryHandlerInterface.php
Normal file
17
src/Query/QueryHandlerInterface.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\Query;
|
||||||
|
|
||||||
|
interface QueryHandlerInterface
|
||||||
|
{
|
||||||
|
}
|
||||||
17
src/Query/QueryInterface.php
Normal file
17
src/Query/QueryInterface.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle\Query;
|
||||||
|
|
||||||
|
interface QueryInterface
|
||||||
|
{
|
||||||
|
}
|
||||||
49
src/Resources/config/services.php
Normal file
49
src/Resources/config/services.php
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
use Psr\Log\LoggerAwareInterface;
|
||||||
|
use Scc\VotingBundle\Collection\VotingMethodCollection;
|
||||||
|
use Scc\VotingBundle\Contract\ElectionMethodAdapterInterface;
|
||||||
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||||
|
|
||||||
|
use function symfony\component\dependencyinjection\loader\configurator\service;
|
||||||
|
use function Symfony\Component\DependencyInjection\Loader\Configurator\tagged_iterator;
|
||||||
|
|
||||||
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||||
|
$services = $containerConfigurator->services();
|
||||||
|
|
||||||
|
$services->defaults()
|
||||||
|
->public()
|
||||||
|
->autowire(true)
|
||||||
|
->autoconfigure()
|
||||||
|
;
|
||||||
|
|
||||||
|
// $services
|
||||||
|
// ->instanceof(LoggerAwareInterface::class)
|
||||||
|
// ->call('setLogger', [service('logger')]);
|
||||||
|
//
|
||||||
|
// $services
|
||||||
|
// ->instanceof(ElectionMethodAdapterInterface::class)
|
||||||
|
// ->tag('scc_voting.method');
|
||||||
|
|
||||||
|
$services->load('Scc\CQRSBundle\\', __DIR__ . '/../../../src')
|
||||||
|
->exclude([
|
||||||
|
__DIR__,
|
||||||
|
__DIR__ . '/../../../src/SccCQRSBundle.php',
|
||||||
|
__DIR__ . '/../../../src/{DependencyInjection}',
|
||||||
|
])
|
||||||
|
;
|
||||||
|
|
||||||
|
// $services->set(VotingMethodCollection::class)
|
||||||
|
// ->args([tagged_iterator('scc_voting.method')]);
|
||||||
|
// $services->alias('scc_voting.method.collection', VotingMethodCollection::class);
|
||||||
|
};
|
||||||
19
src/SccCQRSBundle.php
Normal file
19
src/SccCQRSBundle.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle;
|
||||||
|
|
||||||
|
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||||
|
|
||||||
|
final class SccCQRSBundle extends Bundle
|
||||||
|
{
|
||||||
|
}
|
||||||
17
src/ValueObject.php
Normal file
17
src/ValueObject.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the zapoyok.info project.
|
||||||
|
* (c) <zapoyok.info> <jerome.fix@zapoyok.info>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Zapoyok\CQRSBundle;
|
||||||
|
|
||||||
|
abstract class ValueObject
|
||||||
|
{
|
||||||
|
}
|
||||||
35
tests/bootstrap.php
Normal file
35
tests/bootstrap.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Sonata Project package.
|
||||||
|
*
|
||||||
|
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
use Doctrine\Deprecations\Deprecation;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* DO NOT EDIT THIS FILE!
|
||||||
|
*
|
||||||
|
* It's auto-generated by sonata-project/dev-kit package.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* fix encoding issue while running text on different host with different locale configuration
|
||||||
|
*/
|
||||||
|
setlocale(\LC_ALL, 'en_US.UTF-8');
|
||||||
|
|
||||||
|
require_once __DIR__ . '/../vendor/autoload.php';
|
||||||
|
|
||||||
|
if (class_exists(Deprecation::class)) {
|
||||||
|
Deprecation::enableWithTriggerError();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file_exists($file = __DIR__ . '/custom_bootstrap.php')) {
|
||||||
|
require_once $file;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user