| Total Complexity | 3 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class AuthorUniqueName extends Rule |
||
| 11 | { |
||
| 12 | /** @var string */ |
||
| 13 | protected $message = "Name and birthdate should be unique"; |
||
| 14 | /** @var AuthorRepositoryInterface */ |
||
| 15 | protected AuthorRepositoryInterface $authorRepository; |
||
| 16 | /** @var string */ |
||
| 17 | protected string $birthdate; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * AuthorUniqueName constructor. |
||
| 21 | * @param AuthorRepositoryInterface $authorRepository |
||
| 22 | * @param string $birthdate |
||
| 23 | */ |
||
| 24 | 2 | public function __construct(AuthorRepositoryInterface $authorRepository, string $birthdate) |
|
| 28 | 2 | } |
|
| 29 | |||
| 30 | /** |
||
| 31 | * @param $value |
||
| 32 | * @return bool |
||
| 33 | */ |
||
| 34 | 2 | public function check($value): bool |
|
| 43 |