traderinteractive/filter-floats
Composer 安装命令:
composer require traderinteractive/filter-floats
包简介
A filtering implementation for verifying correct data and performing typical modifications to floats
README 文档
README
A filtering implementation for verifying correct data and performing typical modifications to floats
Requirements
Requires PHP 7.0 or newer and uses composer to install further PHP dependencies. See the composer specification for more details.
Installation
filter-floats-php can be installed for use in your project using composer.
The recommended way of using this library in your project is to add a composer.json file to your project. The following contents would add filter-floats-php as a dependency:
composer require traderinteractive/filter-floats
Included Filters
Floats::filter
This filter verifies that the arguments are of the proper numeric type and allow for bounds checking. 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 next two parameters are the min and max bounds and can be used to limit the domain of allowed numbers.
The final parameter can be set to true to cast integers to floats. Without this, integers will fail validation.
Non-numeric strings will fail validation, and numeric strings will be cast.
The following checks that $value is a float between 1.0 and 100.00 inclusive, and returns the float (after casting it if it was a string or integer).
$value = \TraderInteractive\Filter\Floats::filter($value, false, 1.0, 100.00, true);
Project Build
With a checkout of the code get Composer in your PATH and run: ``sh composer install ./vendor/bin/phpunit ./vendor/bin/phpcs
For more information on our build process, read through out our [Contribution Guidelines](./.github/CONTRIBUTING.md).
traderinteractive/filter-floats 适用场景与选型建议
traderinteractive/filter-floats 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 102.57k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 03 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「filter」 「utility」 「float」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 traderinteractive/filter-floats 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 traderinteractive/filter-floats 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 traderinteractive/filter-floats 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Converter and wrapping object for a number (float or integer) value
Field for number with restricted count of digits and decimal places
Nova searchable filter for belongsTo relationships.
PHP implementation of python's struct module.
A collection of enhancements and utilities for the Silverstripe UserForms module
Symfony DataGridBundle
统计信息
- 总下载量: 102.57k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 25
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-03-06