obf/validator
最新稳定版本:v1.1.1
Composer 安装命令:
composer require obf/validator
包简介
The Opsbears Framework Validator Components
关键字:
README 文档
README
Validators
Validators are classes that validate a value, but don't change it. They can either return true or false, indicating if a value is valid or not.
All validators should implement the iValidator interface:
interface iValidator { /** * @return bool */ public function validate($value); }
Some validators also come with static functions to make type checking easy.
This library comes with a basic set of validators:
| Class | Description |
|---|---|
| BooleanTypeValidator | Does a strict or loose validation if a certain value is a boolean value. |
| BooleanValidator | Only provides type checking for boolean |
Filters
Filters not only validate data, but also process it. This helps with transforming the data in a way that is suitable
for further processing. Filters should implement the iFilter interface:
interface iFilter { public function filter($value); }
The filter module only provides a few basic filters, the rest are implemented in different namespaces:
| Class | Description |
|---|---|
| BooleanFilter | Converts a value into a boolean. It respects the iBooleanConvertible interface from Foundation. Attempts to guess the value if a string is provided, based on the verbs submitted. |
| FloatFilter | Converts a value to a float. It respects the iFloatConvertible interface from Foundation. |
| IntegerFilter | Converts a value to an int. It respects the iIntegerConvertible interface from Foundation. |
| StringFilter | Converts a value to a string. It respects the iStringConvertible interface from Foundation. |
统计信息
- 总下载量: 3.6k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-01-12