Total Complexity | 3 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class WrongDiscriminatorColumnException extends TableInheritanceException implements FriendlyExceptionInterface |
||
12 | { |
||
13 | 4 | public function __construct(private Entity $entity, string $discriminatorColumn) |
|
14 | { |
||
15 | 4 | parent::__construct(sprintf( |
|
16 | 4 | 'Discriminator column `%s` is not found among fields of the `%s` role.', |
|
17 | $discriminatorColumn, |
||
18 | 4 | (string) ($this->entity->getRole() ?? $this->entity->getClass()), |
|
19 | )); |
||
20 | 4 | } |
|
21 | |||
22 | 2 | public function getName(): string |
|
23 | { |
||
24 | 2 | return 'Discriminator column is not found among the entity fields.'; |
|
25 | } |
||
26 | |||
27 | 2 | public function getSolution(): ?string |
|
35 | ); |
||
36 | } |
||
37 | } |
||
38 |