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