定制 obf/validator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

obf/validator

最新稳定版本:v1.1.1

Composer 安装命令:

composer require obf/validator

包简介

The Opsbears Framework Validator Components

关键字:

README 文档

README

Build Status Coverage Status Scrutinizer Code Quality Latest Stable Version License

Validators

Validators are classes that validate a value, but don't change it. They can either return true or false, indicating if a value is valid or not.

All validators should implement the iValidator interface:

interface iValidator {
	/**
	 * @return bool
	 */
	public function validate($value);
}

Some validators also come with static functions to make type checking easy.

This library comes with a basic set of validators:

Class Description
BooleanTypeValidator Does a strict or loose validation if a certain value is a boolean value.
BooleanValidator Only provides type checking for boolean

Filters

Filters not only validate data, but also process it. This helps with transforming the data in a way that is suitable for further processing. Filters should implement the iFilter interface:

interface iFilter {
	public function filter($value);
}

The filter module only provides a few basic filters, the rest are implemented in different namespaces:

Class Description
BooleanFilter Converts a value into a boolean. It respects the iBooleanConvertible interface from Foundation. Attempts to guess the value if a string is provided, based on the verbs submitted.
FloatFilter Converts a value to a float. It respects the iFloatConvertible interface from Foundation.
IntegerFilter Converts a value to an int. It respects the iIntegerConvertible interface from Foundation.
StringFilter Converts a value to a string. It respects the iStringConvertible interface from Foundation.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-12