reflection/validator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

Build Status Code coverage Quality Score Total Downloads Latest Stable Version License

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

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-08-01