[Finder] Avoid unnecessary use of the @ operator
This commit is contained in:
parent
27c41f1e8e
commit
f3408ccf2c
@ -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]));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user