respect-validation/docs/rules/Type.md

46 lines
885 B
Markdown
Raw Normal View History

2015-01-30 09:40:06 +01:00
# Type
- `Type(string $type)`
2015-01-30 09:40:06 +01:00
Validates the type of input.
```php
v::type('bool')->validate(true); // true
v::type('callable')->validate(function (){}); // true
v::type('object')->validate(new stdClass()); // true
2015-01-30 09:40:06 +01:00
```
## Categorization
- Types
## Changelog
Version | Description
--------|-------------
2.0.0 | Became case-sensitive
0.8.0 | Created
***
See also:
2015-01-30 09:40:06 +01:00
2018-12-11 13:31:50 +01:00
- [ArrayType](ArrayType.md)
- [ArrayVal](ArrayVal.md)
- [BoolType](BoolType.md)
2018-12-11 13:31:50 +01:00
- [BoolVal](BoolVal.md)
- [CallableType](CallableType.md)
- [Finite](Finite.md)
- [FloatType](FloatType.md)
- [FloatVal](FloatVal.md)
- [Infinite](Infinite.md)
- [Instance](Instance.md)
- [IntType](IntType.md)
- [IntVal](IntVal.md)
- [NullType](NullType.md)
2018-12-11 13:31:50 +01:00
- [Number](Number.md)
- [ObjectType](ObjectType.md)
- [ResourceType](ResourceType.md)
- [ScalarVal](ScalarVal.md)
- [StringType](StringType.md)
2018-12-11 13:31:50 +01:00
- [StringVal](StringVal.md)