Skip to content

Commit

Permalink
[Finder] Avoid unnecessary use of the @ operator
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Apr 8, 2012
1 parent 27c41f1 commit f3408cc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Symfony/Component/Finder/Comparator/DateComparator.php
Expand Up @@ -32,7 +32,10 @@ public function __construct($test)
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]));
}

Expand Down

0 comments on commit f3408cc

Please sign in to comment.