| Total Complexity | 4 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class Validator implements ValidatorInterface |
||
| 12 | { |
||
| 13 | /** @var RequirementsInterface */ |
||
| 14 | protected RequirementsInterface $requirements; |
||
| 15 | |||
| 16 | /** @var HashInterface */ |
||
| 17 | protected HashInterface $hash; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Validator constructor. |
||
| 21 | * |
||
| 22 | * @param RequirementsInterface|null $requirements |
||
| 23 | * @param HashInterface|null $hash |
||
| 24 | */ |
||
| 25 | public function __construct( |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @inheritdoc |
||
| 35 | */ |
||
| 36 | public function isValid(string $password): bool |
||
| 37 | { |
||
| 38 | return $this->requirements->isValid($password); |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @inheritdoc |
||
| 43 | */ |
||
| 44 | public function createHash(string $password): string |
||
| 45 | { |
||
| 46 | return $this->hash->createHash($password); |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @inheritdoc |
||
| 51 | */ |
||
| 52 | public function passwordVerify(string $password, string $hash): bool |
||
| 55 | } |
||
| 56 | } |
||
| 57 |