Skip to content

Commit

Permalink
Remove redundant try/catch statements
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Aug 13, 2022
1 parent 597bfd0 commit 83627ed
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/Util/ExcludeList.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
use PHPUnit\Framework\TestCase;
use Prophecy\Prophet;
use ReflectionClass;
use ReflectionException;
use SebastianBergmann\CliParser\Parser as CliParser;
use SebastianBergmann\CodeCoverage\CodeCoverage;
use SebastianBergmann\CodeUnit\CodeUnit;
Expand Down Expand Up @@ -233,17 +232,7 @@ private function initialize(): void
continue;
}

try {
$directory = (new ReflectionClass($className))->getFileName();
// @codeCoverageIgnoreStart
} catch (ReflectionException $e) {
throw new Exception(
$e->getMessage(),
(int) $e->getCode(),
$e
);
}
// @codeCoverageIgnoreEnd
$directory = (new ReflectionClass($className))->getFileName();

for ($i = 0; $i < $parent; $i++) {
$directory = dirname($directory);
Expand Down

0 comments on commit 83627ed

Please sign in to comment.