Improve type-safety

This commit is contained in:
Joshua Ramon Enslin 2020-09-25 22:29:56 +02:00 committed by Stefan Rohde-Enslin
parent 68d07c03d8
commit 1cfbfe7743

View File

@ -470,8 +470,8 @@ final class NodaTimeSplitter {
$datum = self::clean_input($datum);
// 0000-0000
if (preg_match("/^[0-9][0-9][0-9][0-9](\-|\/)[0-9][0-9][0-9][0-9]$/", $datum)
|| preg_match("/^[0-9][0-9][0-9][0-9](\-|\/)[0-9][0-9][0-9][0-9]\.$/", $datum)
if (preg_match("/^[0-9][0-9][0-9][0-9](\-|\/)[0-9][0-9][0-9][0-9]$/", $datum) !== false
|| preg_match("/^[0-9][0-9][0-9][0-9](\-|\/)[0-9][0-9][0-9][0-9]\.$/", $datum) !== false
) {
$start = substr($datum, 0, 4);
$end = substr($datum, 5, 4);
@ -667,7 +667,7 @@ final class NodaTimeSplitter {
* @param string $start Begin time.
* @param string $end End time.
*
* @return array<integer>
* @return array<string>
*/
public static function negotiate_century_span_bce_ce(string $start, string $end):array {