[Finder] Avoid unnecessary use of the @ operator

This commit is contained in:
Jordi Boggiano 2012-04-08 19:39:04 +02:00
parent 27c41f1e8e
commit f3408ccf2c

View File

@ -32,7 +32,10 @@ class DateComparator extends Comparator
throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a date test.', $test));
}
if (false === $target = @strtotime($matches[2])) {
try {
$date = new \DateTime($matches[2]);
$target = $date->format('U');
} catch (\Exception $e) {
throw new \InvalidArgumentException(sprintf('"%s" is not a valid date.', $matches[2]));
}