add utils

This commit is contained in:
Simon Vieille 2022-05-07 13:48:51 +02:00
parent d580af9691
commit aaa629a385
Signed by: deblan
GPG key ID: 579388D585F70417

View file

@ -10,12 +10,13 @@ use App\Foo\Bar;
$path = 'path/to/file';
$file = FileAttribute::handleFile($path); // returns an instance of File
$path = 'path/to/file';
$file = FileAttribute::handleFile($path, Bar::class); // returns an instance of Bar
$path = 'path/to/removed_file';
$file = FileAttribute::handleFile($path); // returns null
$path = null;
$file = FileAttribute::handleFile($path); // returns null
$path = 'path/to/file';
$file = FileAttribute::handleFile($path, Bar::class); // returns an instance of Bar
```