Permalink
Browse files

[Finder] Avoid unnecessary use of the @ operator

  • Loading branch information...
1 parent 51bd7df commit 42e22b1a62010e2a78088c3929d9d0034751bfb8 @Seldaek Seldaek committed Apr 8, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 Comparator/DateComparator.php
@@ -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]));
}

0 comments on commit 42e22b1

Please sign in to comment.