respect-validation/docs/rules/File.md

42 lines
722 B
Markdown
Raw Permalink Normal View History

2015-01-30 09:40:06 +01:00
# File
- `File()`
2015-01-30 09:40:06 +01:00
Validates whether file input is as a regular filename.
2015-01-30 09:40:06 +01:00
```php
v::file()->validate(__FILE__); // true
v::file()->validate(__DIR__); // false
2015-01-30 09:40:06 +01:00
```
This validator will consider SplFileInfo instances, so you can do something like:
```php
v::file()->validate(new SplFileInfo('file.txt'));
2015-01-30 09:40:06 +01:00
```
## Categorization
- File system
## Changelog
Version | Description
--------|-------------
0.5.0 | Created
***
See also:
2015-01-30 09:40:06 +01:00
- [Directory](Directory.md)
- [Executable](Executable.md)
- [Exists](Exists.md)
- [Extension](Extension.md)
2018-12-11 13:31:50 +01:00
- [Image](Image.md)
- [Mimetype](Mimetype.md)
- [Readable](Readable.md)
- [Size](Size.md)
- [SymbolicLink](SymbolicLink.md)
- [Uploaded](Uploaded.md)
- [Writable](Writable.md)