Skip to content

Commit

Permalink
improve code style, doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ypnos committed Mar 14, 2016
1 parent db79e7d commit bb9f8c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Validation/Validation.php
Expand Up @@ -463,7 +463,7 @@ public static function time($check)
*
* @param string|\DateTime $check a date string or object (will always pass)
* @param string $type Parser type, one out of 'date', 'time', and 'datetime'
* @param string|int $format any format accepted by IntlDateFormatter
* @param string|int|null $format any format accepted by IntlDateFormatter
* @return bool Success
* @throws \InvalidArgumentException when unsupported $type given
* @see \Cake\I18N\Time::parseDate(), \Cake\I18N\Time::parseTime(), \Cake\I18N\Time::parseDateTime()
Expand All @@ -481,7 +481,7 @@ public static function localizedTime($check, $type = 'datetime', $format = null)
if (empty($methods[$type])) {
throw new \InvalidArgumentException('Unsupported parser type given.');
}
return (!is_null(Time::{$methods[$type]}($check, $format)));
return (Time::{$methods[$type]}($check, $format) !== null);
}

/**
Expand Down

0 comments on commit bb9f8c0

Please sign in to comment.