degraciamathieu / php-file-explorer
Installs: 821
Dependents: 3
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:package
Requires
- php: ^8.1
- symfony/filesystem: ^6.0
Requires (Dev)
- phpunit/phpunit: ^9.5
- symfony/var-dumper: ^5.1|^6.1
README
php-file-explorer
Code originally taken from bmitch/churn-php
composer require degraciamathieu/php-file-explorer
Usage
use DeGraciaMathieu\FileExplorer\FileFinder; $fileFinder = new FileFinder( basePath: __DIR__, ); $files = $fileFinder->getFiles(); foreach ($files as $file) { # DeGraciaMathieu\FileExplorer\File $file->fullPath; $file->displayPath; }
$fileFinder = new FileFinder( basePath: 'app/Modules/', onlyPatterns: [ '.*/Logics/.*', '.*Logic.php', ], ); $files = $fileFinder->getFiles();
$fileFinder = new FileFinder( basePath: 'app/Modules/', ignorePatterns: [ '.*/Repositories/.*', ], ); $files = $fileFinder->getFiles();
$fileFinder = new FileFinder( basePath: 'app/', ); $files = $fileFinder->getFiles([ 'Models/.*', 'Services/.*', ]);
Tests
make test
make coverage