Download src/Billing/Application/CommandHandlers/ReadPlanCommandHandler.php from pnacorp/AIKEEDO: direct link, hf CLI and curl.
- Browser
- Download file 721 Bytes
-
https://huggingface.co/pnacorp/AIKEEDO/resolve/main/src/Billing/Application/CommandHandlers/ReadPlanCommandHandler.php
- Command line
-
hf download hf://pnacorp/AIKEEDO/src/Billing/Application/CommandHandlers/ReadPlanCommandHandler.php
-
curl -L -o ReadPlanCommandHandler.php https://huggingface.co/pnacorp/AIKEEDO/resolve/main/src/Billing/Application/CommandHandlers/ReadPlanCommandHandler.php
721 Bytes
| declare(strict_types=1); | |
| namespace Billing\Application\CommandHandlers; | |
| use Billing\Application\Commands\ReadPlanCommand; | |
| use Billing\Domain\Entities\PlanEntity; | |
| use Billing\Domain\Exceptions\PlanNotFoundException; | |
| use Billing\Domain\Repositories\PlanRepositoryInterface; | |
| class ReadPlanCommandHandler | |
| { | |
| /** | |
| * @param PlanRepositoryInterface $repo | |
| * @return void | |
| */ | |
| public function __construct( | |
| private PlanRepositoryInterface $repo, | |
| ) { | |
| } | |
| /** | |
| * @param ReadPlanCommand $cmd | |
| * @return PlanEntity | |
| * @throws PlanNotFoundException | |
| */ | |
| public function handle(ReadPlanCommand $cmd): PlanEntity | |
| { | |
| return $this->repo->ofId($cmd->id); | |
| } | |
| } | |