Skip to content

Commit

Permalink
Leverage non-capturing catches
Browse files Browse the repository at this point in the history
  • Loading branch information
fancyweb committed Apr 1, 2022
1 parent 6b4a4b7 commit d923a68
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Comparator/DateComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(string $test)
try {
$date = new \DateTime($matches[2]);
$target = $date->format('U');
} catch (\Exception $e) {
} catch (\Exception) {
throw new \InvalidArgumentException(sprintf('"%s" is not a valid date.', $matches[2]));
}

Expand Down
2 changes: 1 addition & 1 deletion Iterator/RecursiveDirectoryIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function hasChildren(bool $allowLinks = false): bool
parent::getChildren();

return true;
} catch (\UnexpectedValueException $e) {
} catch (\UnexpectedValueException) {
// If directory is unreadable and finder is set to ignore it, skip children
return false;
}
Expand Down

0 comments on commit d923a68

Please sign in to comment.