Skip to content

Commit

Permalink
refactor: use hasResults() instead of comparing iterator count of finder
Browse files Browse the repository at this point in the history
  • Loading branch information
vaishnavyogesh committed Jan 28, 2025
1 parent 72e7ff8 commit f497ee0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/FileSystem/InitFilePathsResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,10 @@ public function resolve(string $projectDirectory): array
private function hasDirectoryFileInfoPhpFiles(SplFileInfo $rootDirectoryFileInfo): bool
{
// is directory with PHP files?
$phpFilesCount = Finder::create()
return Finder::create()
->files()
->in($rootDirectoryFileInfo->getPathname())
->name('*.php')
->count();

return $phpFilesCount !== 0;
->hasResults();
}
}

0 comments on commit f497ee0

Please sign in to comment.