Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
31 | public function __invoke(CreateSupplier $command): void |
||
32 | { |
||
33 | if ($this->repository->existsWithName($command->name()->getValue())) { |
||
34 | throw new \DomainException("Supplier with name: {$command->name()->getValue()} already exists."); |
||
35 | } |
||
36 | |||
37 | $supplier = $this->createSupplier($command); |
||
38 | |||
39 | $this->repository->add($supplier); |
||
40 | } |
||
62 |