fix: phpstan level=5
This commit is contained in:
parent
1638d558c5
commit
2947e4aac3
8 changed files with 13 additions and 32 deletions
|
|
@ -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]));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue