klapuch/validation
最新稳定版本:2.6.3
Composer 安装命令:
composer require klapuch/validation
包简介
Broad variation of validation
README 文档
README
Documentation
Installation
composer require klapuch/validation
Usage
Single rule
(new EmptyRule())->satified('abc'); // false (new EmptyRule())->satified(''); // true (new EmptyRule())->apply('abc'); // \UnexpectedValueException - 'Subject is not empty' (new FriendlyRule(new EmptyRule(), 'Not empty!'))->apply('abc'); // \UnexpectedValueException - 'Not empty!'
Chained rule
(new ChainedRule( new FriendlyRule( new NegateRule(new EmptyRule()), 'Value can not be empty' ), new LengthRule(10), new PassiveRule, // it does nothing new EmailRule(), ))->apply('abc');
The above code says that a value can not be empty, length of the value must be exact 10 characters and the value must be email.
统计信息
- 总下载量: 7.18k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2016-12-03