diff --git a/src/Checker/DeadCode/DeadCodeFinder.php b/src/Checker/DeadCode/DeadCodeFinder.php index 62b0df8..8e4a743 100644 --- a/src/Checker/DeadCode/DeadCodeFinder.php +++ b/src/Checker/DeadCode/DeadCodeFinder.php @@ -101,10 +101,8 @@ protected function getAllClassesInUse(string $path): array $fileContent = $file->getContents(); preg_match_all('/use (?\S*)(;| )/m', $fileContent, $matches); - if (isset($matches['useClasses'])) { - foreach ($matches['useClasses'] as $useClass) { - $allClassesInUse[$useClass] = true; - } + foreach ($matches['useClasses'] as $useClass) { + $allClassesInUse[$useClass] = true; } }