Skip to content

Art4es/umbrellio-task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published