Loading Application/Command/Export/ExportContentToGitStore/ExportContentToGitStoreCommand.php 0 → 100644 +11 −0 Original line number Diff line number Diff line <?php declare(strict_types=1); namespace App\Context\Content\Application\Command\Export\ExportContentToGitStore; use App\Context\Shared\Domain\Bus\Command\Command; class ExportContentToGitStoreCommand implements Command { } Application/Command/Export/ExportContentToGitStore/ExportContentToGitStoreHandler.php 0 → 100644 +31 −0 Original line number Diff line number Diff line <?php declare(strict_types=1); namespace App\Context\Content\Application\Command\Export\ExportContentToGitStore; use App\Context\Content\Application\Process\Export\Content\ExportContentService; use App\Context\Content\Application\Service\Git\GitStore; use App\Context\Shared\Domain\Bus\Command\CommandHandler; class ExportContentToGitStoreHandler implements CommandHandler { public function __construct( protected readonly GitStore $gitStore, protected readonly ExportContentService $exportContentService, ) { } public function __invoke(ExportContentToGitStoreCommand $command): ExportContentToGitStoreResponse { try { $this->gitStore->pull(); $this->exportContentService->run(); $this->gitStore->push(); } finally { $this->gitStore->clean(); } return new ExportContentToGitStoreResponse(); } } Application/Command/Export/ExportContentToGitStore/ExportContentToGitStoreResponse.php 0 → 100644 +11 −0 Original line number Diff line number Diff line <?php declare(strict_types=1); namespace App\Context\Content\Application\Command\Export\ExportContentToGitStore; use App\Context\Shared\Domain\Bus\Command\CommandResponse; class ExportContentToGitStoreResponse implements CommandResponse { } Application/Command/Level/AssignLevelModerator/AssignLevelModeratorCommand.php 0 → 100644 +17 −0 Original line number Diff line number Diff line <?php declare(strict_types=1); namespace App\Context\Content\Application\Command\Level\AssignLevelModerator; use App\Context\Shared\Domain\Bus\Command\Command; class AssignLevelModeratorCommand implements Command { public function __construct( public readonly string $skillId, public readonly string $levelId, public readonly string $memberId, ) { } } Application/Command/Level/AssignLevelModerator/AssignLevelModeratorCommandResponse.php 0 → 100644 +21 −0 Original line number Diff line number Diff line <?php declare(strict_types=1); namespace App\Context\Content\Application\Command\Level\AssignLevelModerator; use App\Context\Shared\Domain\Aggregate\AggregateId; use App\Context\Shared\Domain\Bus\Command\AggregateCommandResponse; class AssignLevelModeratorCommandResponse implements AggregateCommandResponse { public function __construct( private readonly AggregateId $id ) { } public function getAggregateId(): AggregateId { return $this->id; } } Loading
Application/Command/Export/ExportContentToGitStore/ExportContentToGitStoreCommand.php 0 → 100644 +11 −0 Original line number Diff line number Diff line <?php declare(strict_types=1); namespace App\Context\Content\Application\Command\Export\ExportContentToGitStore; use App\Context\Shared\Domain\Bus\Command\Command; class ExportContentToGitStoreCommand implements Command { }
Application/Command/Export/ExportContentToGitStore/ExportContentToGitStoreHandler.php 0 → 100644 +31 −0 Original line number Diff line number Diff line <?php declare(strict_types=1); namespace App\Context\Content\Application\Command\Export\ExportContentToGitStore; use App\Context\Content\Application\Process\Export\Content\ExportContentService; use App\Context\Content\Application\Service\Git\GitStore; use App\Context\Shared\Domain\Bus\Command\CommandHandler; class ExportContentToGitStoreHandler implements CommandHandler { public function __construct( protected readonly GitStore $gitStore, protected readonly ExportContentService $exportContentService, ) { } public function __invoke(ExportContentToGitStoreCommand $command): ExportContentToGitStoreResponse { try { $this->gitStore->pull(); $this->exportContentService->run(); $this->gitStore->push(); } finally { $this->gitStore->clean(); } return new ExportContentToGitStoreResponse(); } }
Application/Command/Export/ExportContentToGitStore/ExportContentToGitStoreResponse.php 0 → 100644 +11 −0 Original line number Diff line number Diff line <?php declare(strict_types=1); namespace App\Context\Content\Application\Command\Export\ExportContentToGitStore; use App\Context\Shared\Domain\Bus\Command\CommandResponse; class ExportContentToGitStoreResponse implements CommandResponse { }
Application/Command/Level/AssignLevelModerator/AssignLevelModeratorCommand.php 0 → 100644 +17 −0 Original line number Diff line number Diff line <?php declare(strict_types=1); namespace App\Context\Content\Application\Command\Level\AssignLevelModerator; use App\Context\Shared\Domain\Bus\Command\Command; class AssignLevelModeratorCommand implements Command { public function __construct( public readonly string $skillId, public readonly string $levelId, public readonly string $memberId, ) { } }
Application/Command/Level/AssignLevelModerator/AssignLevelModeratorCommandResponse.php 0 → 100644 +21 −0 Original line number Diff line number Diff line <?php declare(strict_types=1); namespace App\Context\Content\Application\Command\Level\AssignLevelModerator; use App\Context\Shared\Domain\Aggregate\AggregateId; use App\Context\Shared\Domain\Bus\Command\AggregateCommandResponse; class AssignLevelModeratorCommandResponse implements AggregateCommandResponse { public function __construct( private readonly AggregateId $id ) { } public function getAggregateId(): AggregateId { return $this->id; } }