reflection/validator
最新稳定版本:1.0.1
Composer 安装命令:
composer require reflection/validator
包简介
Define a specification of PHP entity and check whether the particular item matches it.
README 文档
README
When might it be useful?
Sometimes you may want to have an unlimited sequence of methods, which cannot be restricted/controlled by the interface. In this case on a "compilation" stage, you can restrict those methods to follow the standards you expect.
A real example from Drupal/Symfony world: http://cgit.drupalcode.org/form_alter_service/tree/src/FormAlterCompilerPass.php
Examples
Besides of fully-operable examples, you can check a quick use case:
(new MethodValidator(object<ReflectionMethod>, string<FQCN>)) ->addArgument( (new ArgumentSpecification('form')) ->setType('array') ->setOptional(false) ->setPassedByReference(true) ) ->addArgument( (new ArgumentSpecification('formState')) ->setType(Iterator::class) ->setOptional(false) ->setPassedByReference(false) );
统计信息
- 总下载量: 188.17k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-08-01