8000 [Finder] Avoid unnecessary use of the @ operator · phreaknerd/symfony@f3408cc · GitHub
[go: up one dir, main page]

Skip to content

Commit f3408cc

Browse files
committed
[Finder] Avoid unnecessary use of the @ operator
1 parent 27c41f1 commit f3408cc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Symfony/Component/Finder/Comparator/DateComparator.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ public function __construct($test)
3232
throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a date test.', $test));
3333
}
3434

35-
if (false === $target = @strtotime($matches[2])) {
35+
try {
36+
$date = new \DateTime($matches[2]);
37+
$target = $date->format('U');
38+
} catch (\Exception $e) {
3639
throw new \InvalidArgumentException(sprintf('"%s" is not a valid date.', $matches[2]));
3740
}
3841

0 commit comments

Comments
 (0)
0