mirror of
https://github.com/Respect/Validation.git
synced 2024-05-29 03:42:25 +02:00
10df3211f5
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
44 lines
806 B
Markdown
44 lines
806 B
Markdown
# Directory
|
|
|
|
- `Directory()`
|
|
|
|
Validates if the given path is a directory.
|
|
|
|
```php
|
|
v::directory()->validate(__DIR__); // true
|
|
v::directory()->validate(__FILE__); // false
|
|
```
|
|
|
|
This validator will consider SplFileInfo instances, so you can do something like:
|
|
|
|
```php
|
|
v::directory()->validate(new SplFileInfo('library/'));
|
|
v::directory()->validate(dir('/'));
|
|
```
|
|
|
|
## Categorization
|
|
|
|
- File system
|
|
|
|
## Changelog
|
|
|
|
Version | Description
|
|
--------|-------------
|
|
2.0.0 | Validates PHP's `Directory` class
|
|
0.4.4 | Created
|
|
|
|
***
|
|
See also:
|
|
|
|
- [Executable](Executable.md)
|
|
- [Exists](Exists.md)
|
|
- [Extension](Extension.md)
|
|
- [File](File.md)
|
|
- [Image](Image.md)
|
|
- [Mimetype](Mimetype.md)
|
|
- [Readable](Readable.md)
|
|
- [Size](Size.md)
|
|
- [SymbolicLink](SymbolicLink.md)
|
|
- [Uploaded](Uploaded.md)
|
|
- [Writable](Writable.md)
|