Initial commit
This commit is contained in:
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
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user