定制 district5/filters 二次开发

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

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

district5/filters

最新稳定版本:3.1.0

Composer 安装命令:

composer require district5/filters

包简介

District5 Filters Library

README 文档

README

codecov

PHP Filters

A collection of filters implementing the District5 Filter interface.

Installation

Install using composer:

composer require district5/filters

Usage

All filters in this library conform to the District5 Filter interface. All can be used in the same way:

$value = 'Hello';

$filter = new \District5\Filters\StringLower();
$filteredValue = $filter->filter($value);   // 'hello'

These filters do not guarantee consistent return filtered items if the input has not been validated first, for example ArrayOfStringToInt relies on the strings being a value that can be converted as intval is utilised.

You should validate input first; these filters can then be used to add business logic to the validated data. If for example you wanted to store hex colour codes but allow users the flexibility of either including or omitting the #, you would need to validate that the string is indeed a hex code, and then run it through the filter to make sure you always utilise / persist the codes consistently.

To make use of this combined functionality please see Validation Groups library.

Available Filters

  • Array of strings to lower case
  • Array of strings to upper case
  • Array of strings to integers
  • Array of strings to an array of the unique values
  • Array of strings with all strings trimmed
  • String to lower case
  • String to upper case
  • String trim
  • String to UCS Words

Issues

Log a bug report!

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: mit
  • 更新时间: 2024-02-26