feat: suite des rêgles de phparkitect + début d'un domain Shared avec les interfaces CQRS
This commit is contained in:
parent
e444d79101
commit
fe92e53be7
15
src/Domain/Shared/Contract/CommandHandlerInterface.php
Normal file
15
src/Domain/Shared/Contract/CommandHandlerInterface.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\Shared\Contract;
|
||||
|
||||
interface CommandHandlerInterface
|
||||
{
|
||||
/**
|
||||
* @template T of CommandInterface
|
||||
* @param T $command
|
||||
* @return void
|
||||
*/
|
||||
public function handle(CommandInterface $command): void;
|
||||
}
|
||||
9
src/Domain/Shared/Contract/CommandInterface.php
Normal file
9
src/Domain/Shared/Contract/CommandInterface.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\Shared\Contract;
|
||||
|
||||
interface CommandInterface
|
||||
{
|
||||
}
|
||||
16
src/Domain/Shared/Contract/QueryHandlerInterface.php
Normal file
16
src/Domain/Shared/Contract/QueryHandlerInterface.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\Shared\Contract;
|
||||
|
||||
interface QueryHandlerInterface
|
||||
{
|
||||
/**
|
||||
* @template T of QueryInterface
|
||||
* @template R of ResponseInterface
|
||||
* @param T $query
|
||||
* @return R
|
||||
*/
|
||||
public function handle(QueryInterface $query): ResponseInterface;
|
||||
}
|
||||
9
src/Domain/Shared/Contract/QueryInterface.php
Normal file
9
src/Domain/Shared/Contract/QueryInterface.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\Shared\Contract;
|
||||
|
||||
interface QueryInterface
|
||||
{
|
||||
}
|
||||
9
src/Domain/Shared/Contract/ResponseInterface.php
Normal file
9
src/Domain/Shared/Contract/ResponseInterface.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\Shared\Contract;
|
||||
|
||||
interface ResponseInterface
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user