art4es / finder
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/art4es/finder
Requires
- php: >=7.2
- ext-fileinfo: *
- ext-yaml: *
Requires (Dev)
- phpunit/phpunit: ^8.3
This package is auto-updated.
Last update: 2025-12-20 20:59:09 UTC
README
Installation: "composer require art4es/finder"
Works perfect with absolute paths and paths relative to usage location.
Usage:
$file = new File('path/to/file.txt'); $strategy = new SubstringSearchingStrategy('searchingWord'); $validatorsProvider = new YamlValidatorsProvider('path/to/config.yaml'); //if you need validate file $finder = new Finder($file, $strategy, $validatorsProvider);
config.yaml example:
mime_types: - 'text/plain' - 'application/json' extension: - 'bmp' - 'jpeg' file_size: min: 10 max: 60
Position of validators in the config file affects to the order of validation.
There are 3 configurable Validators out-of-the-box:
- ExtensionValidator
- FileSizeValidator
- MimeTypeValidator