| Total Complexity | 6 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | class ReadCompany implements ReadCompanyDomain |
||
| 23 | { |
||
| 24 | private CompanyRepository $companyRepository; |
||
| 25 | |||
| 26 | public function __construct(CompanyRepository $companyRepository) |
||
| 27 | { |
||
| 28 | $this->companyRepository = $companyRepository; |
||
| 29 | } |
||
| 30 | |||
| 31 | public function existsWithName(string $companyName): bool |
||
| 32 | { |
||
| 33 | return $this->companyRepository->existsWithName($companyName); |
||
| 34 | } |
||
| 35 | |||
| 36 | public function findOneByUuid(string $uuid): ?Company |
||
| 37 | { |
||
| 38 | $company = $this->companyRepository->findOneByUuid(ResourceUuid::fromString($uuid)); |
||
| 39 | |||
| 40 | if (!$company instanceof Company) { |
||
| 41 | throw new CompanyNotFoundException(); |
||
| 42 | } |
||
| 43 | |||
| 44 | return $company; |
||
| 45 | } |
||
| 46 | |||
| 47 | public function companyExist(): bool |
||
| 48 | { |
||
| 49 | return $this->companyRepository->companyExist(); |
||
| 50 | } |
||
| 51 | |||
| 52 | public function findAll(): array |
||
| 55 | } |
||
| 56 | } |
||
| 57 |