diff --git a/lib/validator/sfValidatorDate.class.php b/lib/validator/sfValidatorDate.class.php index e14fb13e5..19502c8c4 100644 --- a/lib/validator/sfValidatorDate.class.php +++ b/lib/validator/sfValidatorDate.class.php @@ -189,9 +189,9 @@ protected function convertDateArrayToString($value) (int) $value['year'], (int) $value['month'], (int) $value['day'], - isset($value['hour']) ? (int) $value['hour'] : 0, - isset($value['minute']) ? (int) $value['minute'] : 0, - isset($value['second']) ? (int) $value['second'] : 0 + (int) $value['hour'] ?? 0, + (int) $value['minute'] ?? 0, + (int) $value['second'] ?? 0, ); } else { $clean = sprintf( diff --git a/lib/validator/sfValidatorTime.class.php b/lib/validator/sfValidatorTime.class.php index bfc949d69..f2e2507d8 100644 --- a/lib/validator/sfValidatorTime.class.php +++ b/lib/validator/sfValidatorTime.class.php @@ -96,9 +96,9 @@ protected function convertTimeArrayToTimestamp($value) } $clean = mktime( - isset($value['hour']) ? (int) $value['hour'] : 0, - isset($value['minute']) ? (int) $value['minute'] : 0, - isset($value['second']) ? (int) $value['second'] : 0 + (int) $value['hour'] ?? 0, + (int) $value['minute'] ?? 0, + (int) $value['second'] ?? 0, ); if (false === $clean) {