fix: phpstan. Удаление State
This commit is contained in:
parent
4ac027b8ee
commit
1638d558c5
6 changed files with 22 additions and 97 deletions
|
|
@ -47,21 +47,23 @@ class Primitive {
|
|||
{
|
||||
$result = 0;
|
||||
$tmp = explode("/", $value ?? '', 3);
|
||||
if (!empty($tmp)) {
|
||||
if (count($tmp) != 3) return $result;
|
||||
|
||||
if (count($tmp) != 3) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
$year = (int)$tmp[2];
|
||||
$month = (int)$tmp[1];
|
||||
$day = (int)$tmp[0];
|
||||
$year = (int)$tmp[2];
|
||||
$month = (int)$tmp[1];
|
||||
$day = (int)$tmp[0];
|
||||
|
||||
if ($month != 0 && $day != 0 && $year != 0) {
|
||||
if (checkdate($month, $day, $year)) {
|
||||
return mktime(0, 0, 0, $month, $day, $year);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
if ($month != 0 && $day != 0 && $year != 0) {
|
||||
if (checkdate($month, $day, $year)) {
|
||||
return mktime(0, 0, 0, $month, $day, $year);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue