traderinteractive/filter-bools
Composer 安装命令:
composer require traderinteractive/filter-bools
包简介
A collection of boolean filters.
README 文档
README
A filtering implementation for verifying correct data and performing typical modifications to data.
Requirements
Requires PHP 7.0 or newer and uses composer to install further PHP dependencies. See the composer specification for more details.
Composer
To add the library as a local, per-project dependency use Composer! Simply add a dependency on
traderinteractive/filter-bools to your project's composer.json file such as:
composer require traderinteractive/filter-bools
Functionality
Booleans::filter
This filter verifies that the argument is a boolean value or a string that maps to one. The second parameter
can be set to true to allow null values through without an error (they will stay null and not get converted to false). The last parameters
are lists of strings for true values and false values. By default, the strings "true" and "false" map to their boolean counterparts.
The following example converts $value to a boolean allowing the strings "on" and "of".
$enabled = \TraderInteractive\Filter\Booleans::filter($value, false, ['on'], ['off']);
Booleans::convert
This filter will convert a given boolean value into the provided true or false conditions. By default the return values are the strings 'true' and 'false'
The following converts the boolean $value to either 'yes' or 'no'
$answer = \TraderInteractive\Filter\Booleans::convert($value, 'yes', 'no');
Contact
Developers may be contacted at:
Project Build
With a checkout of the code get Composer in your PATH and run:
composer install ./vendor/bin/phpcs ./vendor/bin/phpunit
For more information on our build process, read through out our Contribution Guidelines.
traderinteractive/filter-bools 适用场景与选型建议
traderinteractive/filter-bools 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 102.35k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 03 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「boolean」 「bool」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 traderinteractive/filter-bools 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 traderinteractive/filter-bools 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 traderinteractive/filter-bools 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Automatically convert Eloquent model boolean attributes to dates (and back).
A simple Symfony bundle that adds boolean form field type.
A way to translate Boolean Search logic into MySQL Fulltext Parameters
Lightweight boolean container with stand-alone converter
Laravel Eloquent boolean & timestamp flagged attributes behavior.
Static classes to help with numbers, strings, arrays, files, and bools in PHP
统计信息
- 总下载量: 102.35k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 21
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-03-06