-
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.
* entity service node * entity service node * fix data
- Loading branch information
Showing
45 changed files
with
1,008 additions
and
128 deletions.
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
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
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,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace kuaukutsu\poc\task; | ||
|
||
use Psr\Container\ContainerExceptionInterface; | ||
use kuaukutsu\poc\task\service\StageCommand; | ||
use kuaukutsu\poc\task\service\StageQuery; | ||
use kuaukutsu\poc\task\service\TaskCommand; | ||
use kuaukutsu\poc\task\service\TaskQuery; | ||
|
||
interface EntityNode | ||
{ | ||
public function label(): string; | ||
|
||
/** | ||
* @throws ContainerExceptionInterface | ||
*/ | ||
public function getTaskQuery(): TaskQuery; | ||
|
||
/** | ||
* @throws ContainerExceptionInterface | ||
*/ | ||
public function getTaskCommand(): TaskCommand; | ||
|
||
/** | ||
* @throws ContainerExceptionInterface | ||
*/ | ||
public function getStageQuery(): StageQuery; | ||
|
||
/** | ||
* @throws ContainerExceptionInterface | ||
*/ | ||
public function getStageCommand(): StageCommand; | ||
} |
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
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
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,40 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace kuaukutsu\poc\task\tools; | ||
|
||
use DI\FactoryInterface; | ||
use Psr\Container\ContainerExceptionInterface; | ||
use kuaukutsu\poc\task\EntityNode; | ||
|
||
/** | ||
* @template T | ||
*/ | ||
final class NodeServiceFactory | ||
{ | ||
public function __construct(private readonly FactoryInterface $factory) | ||
{ | ||
} | ||
|
||
/** | ||
* @param class-string<T> $serviceName | ||
* @return T | ||
* @throws ContainerExceptionInterface | ||
*/ | ||
public function factory(EntityNode $node, string $serviceName) | ||
{ | ||
/** | ||
* @var T | ||
*/ | ||
return $this->factory->make( | ||
$serviceName, | ||
[ | ||
'taskQuery' => $node->getTaskQuery(), | ||
'taskCommand' => $node->getTaskCommand(), | ||
'stageQuery' => $node->getStageQuery(), | ||
'stageCommand' => $node->getStageCommand(), | ||
] | ||
); | ||
} | ||
} |
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
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
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,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Symfony\Component\Console\Output\ConsoleOutput; | ||
use Symfony\Component\Console\Output\ConsoleOutputInterface; | ||
use kuaukutsu\poc\task\service\StageCommand; | ||
use kuaukutsu\poc\task\service\StageQuery; | ||
use kuaukutsu\poc\task\service\TaskCommand; | ||
use kuaukutsu\poc\task\service\TaskQuery; | ||
use kuaukutsu\poc\task\tests\nodes\even\EvenStageCommand; | ||
use kuaukutsu\poc\task\tests\nodes\even\EvenStageQuery; | ||
use kuaukutsu\poc\task\tests\nodes\even\EvenTaskCommand; | ||
use kuaukutsu\poc\task\tests\nodes\even\EvenTaskQuery; | ||
|
||
use function DI\autowire; | ||
use function DI\create; | ||
|
||
require_once dirname(__DIR__, 2) . '/vendor/autoload.php'; | ||
|
||
$definitions = [ | ||
TaskQuery::class => autowire(EvenTaskQuery::class), | ||
TaskCommand::class => autowire(EvenTaskCommand::class), | ||
StageQuery::class => autowire(EvenStageQuery::class), | ||
StageCommand::class => autowire(EvenStageCommand::class), | ||
ConsoleOutputInterface::class => create(ConsoleOutput::class), | ||
]; |
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,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Symfony\Component\Console\Output\ConsoleOutput; | ||
use Symfony\Component\Console\Output\ConsoleOutputInterface; | ||
use kuaukutsu\poc\task\service\StageCommand; | ||
use kuaukutsu\poc\task\service\StageQuery; | ||
use kuaukutsu\poc\task\service\TaskCommand; | ||
use kuaukutsu\poc\task\service\TaskQuery; | ||
use kuaukutsu\poc\task\tests\nodes\odd\OddStageCommand; | ||
use kuaukutsu\poc\task\tests\nodes\odd\OddStageQuery; | ||
use kuaukutsu\poc\task\tests\nodes\odd\OddTaskCommand; | ||
use kuaukutsu\poc\task\tests\nodes\odd\OddTaskQuery; | ||
|
||
use function DI\autowire; | ||
use function DI\create; | ||
|
||
require_once dirname(__DIR__, 2) . '/vendor/autoload.php'; | ||
|
||
$definitions = [ | ||
TaskQuery::class => autowire(OddTaskQuery::class), | ||
TaskCommand::class => autowire(OddTaskCommand::class), | ||
StageQuery::class => autowire(OddStageQuery::class), | ||
StageCommand::class => autowire(OddStageCommand::class), | ||
ConsoleOutputInterface::class => create(ConsoleOutput::class), | ||
]; |
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
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
Oops, something went wrong.