Set phpstan tmp dir, Basic class check date/time empty date fix
set explicit tmp folder for phpstan to not overlap with other users Basic class return false for unset date or datetime parameter
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
// Boostrap file for PHPstand
|
||||
// sets the _SERVER['HTTP_HOST'] var so we can have DB detection
|
||||
$_SERVER['HTTP_HOST'] = 'soba.tokyo.tequila.jp';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# PHP Stan Config
|
||||
|
||||
parameters:
|
||||
tmpDir: /tmp/phpstan-clemens
|
||||
level: 1
|
||||
paths:
|
||||
- %currentWorkingDirectory%/www
|
||||
|
||||
@@ -1664,6 +1664,9 @@ class Basic
|
||||
*/
|
||||
public static function checkDate($date): bool
|
||||
{
|
||||
if (!$date) {
|
||||
return false;
|
||||
}
|
||||
list ($year, $month, $day) = preg_split("/[\/-]/", $date);
|
||||
if (!$year || !$month || !$day) {
|
||||
return false;
|
||||
@@ -1681,6 +1684,9 @@ class Basic
|
||||
*/
|
||||
public static function checkDateTime($datetime): bool
|
||||
{
|
||||
if (!$datetime) {
|
||||
return false;
|
||||
}
|
||||
list ($year, $month, $day, $hour, $min, $sec) = preg_split("/[\/\- :]/", $datetime);
|
||||
if (!$year || !$month || !$day) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user