-
Notifications
You must be signed in to change notification settings - Fork 2
FileSystem
Pieter Hordijk edited this page Dec 31, 2018
·
1 revision
Validates the input (string) to be a valid directory.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\FileSystem\Directory;
(new Directory())->validate('/path/to/a/directory');-
Type.Stringwhen the validated value is not a string -
FileSystem.Directorywhen the directory does not exists
Validates the input (string) to be a valid path.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\FileSystem\Exists;
(new Exists())->validate('/path/to');-
Type.Stringwhen the validated value is not a string -
FileSystem.Existswhen the path is valid
Validates the input (string) to be a valid file.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\FileSystem\File;
(new File())->validate('/path/to/a/file.txt');-
Type.Stringwhen the validated value is not a string -
FileSystem.Filewhen the file does not exists