承接 qlimix/validation 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

qlimix/validation

Composer 安装命令:

composer require qlimix/validation

包简介

Validate data individually or by set

README 文档

README

Travis CI Coveralls Mutation testing badge Packagist MIT License

Validate data individually or by set.

Install

Using Composer:

$ composer require qlimix/validation

usage

Example 1 Collection

[
    {
        "foo": "bar",
        "foobar": {
            "bar": 1,
            "foo": "example"
        }
    },
    {
        "foo": "foo",
        "foobar": {
            "bar": 2,
            "foo": "example1"
        }
    }
]
<?php

use Qlimix\Validation\CollectionValidation;
use Qlimix\Validation\Inspector\HashInspector;
use Qlimix\Validation\Inspector\KeyInspector;
use Qlimix\Validation\Key;

$example1 = new CollectionValidation([
    new HashInspector([new Key('foo', true, [])]), // add validators
    new KeyInspector('foobar', true, [
        new HashInspector([
            new Key('bar', true, []), // add validators
            new Key('foo', true, []), // add validators
        ])
    ])
]);

Example 2 key values

{
    "foo": "foobar",
    "foobar": {
        "bar": 42,
        "foo": "example2"
    }
}
<?php

use Qlimix\Validation\Inspector\HashInspector;
use Qlimix\Validation\Inspector\KeyInspector;
use Qlimix\Validation\InspectorValidation;
use Qlimix\Validation\Key;

$example2 = new InspectorValidation([
    new HashInspector([new Key('foo', true, [])]), // add validators
    new KeyInspector('foobar', true, [
        new HashInspector([
            new Key('bar', true, []), // add validators
            new Key('bar', true, []), // add validators
        ])
    ])
]);

Testing

To run all unit tests locally with PHPUnit:

$ vendor/bin/phpunit

Quality

To ensure code quality run grumphp which will run all tools:

$ vendor/bin/grumphp run

Contributing

Please see CONTRIBUTING for details.

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-06-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固