fix: phpstan level=5

This commit is contained in:
origami11@yandex.ru 2024-01-24 17:13:38 +03:00
parent 1638d558c5
commit 2947e4aac3
8 changed files with 13 additions and 32 deletions

View file

@ -9,8 +9,6 @@ use ctiso\Validator\Rule\AbstractRule,
class Date extends AbstractRule
{
private $split = "\\/";
public function getErrorMsg()
{
return "Неверный формат даты";
@ -21,7 +19,7 @@ class Date extends AbstractRule
$pattern = "/^([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4})$/";
$matches = [];
return (preg_match($pattern, $container->get($this->field), $matches)
&& checkdate($matches[2], $matches[1], $matches[3]));
&& checkdate((int)$matches[2], (int)$matches[1], (int)$matches[3]));
}
}