lamiaoy/validation 问题修复 & 功能扩展

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

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

lamiaoy/validation

最新稳定版本:1.0.2

Composer 安装命令:

composer require lamiaoy/validation

包简介

README 文档

README

General Validation library

Overview and structure

The library provides a collection of interfaces and some default implementations for the task of validation.

ValidationUtils is an interface of common functions that can be shared through validating classes (typically implementing for example TypeValidation)

ValidationDefaultValues is an interface providding a list of default values for validation constraints so if the constraint x is not set for field y, the constraint x will be validated against default value for field y (this way only the values differing from default need to be confed).

  • ValidationDefaultValuesImpl is an implementing class that takes it's values from ini file that is injected as a path to constructor of the class.

ValidationCollection is a collection of TypeValidations.

TypeValidation is a general interface for a simple validation.

  • Implementing base class is AbstractTypeValidation

    • Common validation functions injected as ValidationUtils interface
    • Default values injected as ValidationDefaultValues interface
  • ArrayValidation, StringValidation etc typically extend AbstractTypeValidation

  • GeneralValidation is an implementation that coordinates a group of TypeValidation implementations injected to it in ValidationCollection through constructor. The TypeValidation implementation of given type is used for validating, unless not defined whereas the default type is used.

Validation is a general interface for taking an array of fields and validating them with constructor injected TypeValidation against the field constraint configuration also injected into constructor.

Example usage

Contribution guidelines

  • Implementation classes must be unit tested

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2017-02-23