diff --git a/www/admin/class_test.strings.php b/www/admin/class_test.strings.php index 4e08b2fa..23b26075 100644 --- a/www/admin/class_test.strings.php +++ b/www/admin/class_test.strings.php @@ -21,8 +21,6 @@ require 'config.php'; $LOG_FILE_ID = 'classTest-string'; ob_end_flush(); -use CoreLibs\Convert\Byte; - $log = new CoreLibs\Debug\Logging([ 'log_folder' => BASE . LOG, 'file_id' => $LOG_FILE_ID, diff --git a/www/lib/CoreLibs/Combined/DateTime.php b/www/lib/CoreLibs/Combined/DateTime.php index 728f5e0e..56db0dba 100644 --- a/www/lib/CoreLibs/Combined/DateTime.php +++ b/www/lib/CoreLibs/Combined/DateTime.php @@ -209,7 +209,7 @@ class DateTime if ($isodow < 1 || $isodow > 7) { return $long ? 'Invalid' : 'Inv'; } - return date($long ? 'l' : 'D', strtotime("Sunday +{$isodow} days")); + return date($long ? 'l' : 'D', strtotime("Sunday +{$isodow} days") ?: null); } /** @@ -224,7 +224,7 @@ class DateTime if (!self::checkDate($date)) { return $long ? 'Invalid' : 'Inv'; } - return date($long ? 'l' : 'D', strtotime($date)); + return date($long ? 'l' : 'D', strtotime($date) ?: null); } /** @@ -238,7 +238,7 @@ class DateTime if (!self::checkDate($date)) { return -1; } - return (int)date('N', strtotime($date)); + return (int)date('N', strtotime($date) ?: null); } /** diff --git a/www/lib/CoreLibs/Convert/Strings.php b/www/lib/CoreLibs/Convert/Strings.php index a820fcdc..09a99756 100644 --- a/www/lib/CoreLibs/Convert/Strings.php +++ b/www/lib/CoreLibs/Convert/Strings.php @@ -29,7 +29,7 @@ class Strings public static function splitFormatString( string $value, string $split_format, - string $split_charcters = '-' + string $split_characters = '-' ): string { // abort if split format is empty if (empty($split_format)) { @@ -45,7 +45,7 @@ class Strings // } $split_list = preg_split( // allowed split characters - "/([" . $split_charcters . "]{1})/", + "/([" . $split_characters . "]{1})/", $split_format, -1, PREG_SPLIT_DELIM_CAPTURE @@ -74,7 +74,7 @@ class Strings $out .= $last_split . substr($value, $pos); } // if last is not alphanumeric remove, remove - if (!strcspn(substr($out, -1, 1), $split_charcters)) { + if (!strcspn(substr($out, -1, 1), $split_characters)) { $out = substr($out, 0, -1); } // overwrite only if out is set