estasi/filter
Composer 安装命令:
composer require estasi/filter
包简介
Filtering and normalizing data and files
README 文档
README
This is a set of frequently used, unchangeable filters that are required. Provides a simple data filtering chain that allows you to apply multiple filters in the specified order.
Installation
To install with a composer:
composer require estasi/filter
Requirements
- PHP 7.4 or newer
- ext-mbstring
- ext-intl
- Data Structures:
composer require php-ds/php-ds
Polyfill is installed with the estasi/filter package.
Usage
Basic usage
<?php declare(strict_types=1); use Estasi\Filter\CamelCase; $filter = new CamelCase(); echo $filter->filter('camel case'); // camelCase // or echo $filter('camel_case'); // camelCase
Chain
Here are two filters tasks in the chain: explicitly (by class declaration) and via the factory (array):
<?php declare(strict_types=1); use Estasi\Filter\{Chain,Trim}; $string = ' camel case string '; $chain = new Chain(Chain::DEFAULT_PLUGIN_MANAGER, 'trim', 'camelCase'); // the same thing $chain = new Chain(); $chain = $chain->attach(new Trim()) ->attach([Chain::FILTER_NAME => 'camelCase']); // or attach('camelCase') echo $chain->filter($string); // "camelCaseString"
License
All contents of this package are licensed under the BSD-3-Clause license.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2020-05-20