data-values/interfaces
Composer 安装命令:
composer require data-values/interfaces
包简介
Defines interfaces for ValueParsers, ValueFormatters and ValueValidators
README 文档
README
The design of this library is poor and its reason for existing is questionable. Most of the time you are likely better served by creating dedicated interfaces within your project.
DataValues Interfaces is a small PHP library that defines a set of interfaces for parsers, formatters, and validators. It is part of the DataValues set of libraries.
On Packagist:
Installation
To use this library in your project, simply add a dependency on data-values/interfaces
to your project's composer.json file. Here is a minimal example of a composer.json
file that just defines a dependency on Interfaces 1.x:
{
"require": {
"data-values/interfaces": "^1.0"
}
}
Tests
This library comes with a set up PHPUnit tests that cover all non-trivial code. You can run these tests using the PHPUnit configuration file found in the root directory. The tests can also be run via Github Actions.
Release notes
1.2.0 (2024-12-10)
- Dropped support for PHP 7.2 and PHP 7.3
- Improved support for PHP 8.4 by explicitly declaring nullable types
- Upgraded codesniffer rules to current
mediawiki/mediawiki-codesnifferversion (45.0.0) - Added testing with PHP 8.1 up to 8.4
1.1.0 (dev)
- Introduced
ParserOptions::withDefaultOption()andFormatterOptions::withDefaultOption(), which return a copy of the options with the default applied; thedefaultOption()methods, which modify the options in place, are deprecated.
1.0.0 (2021-01-20)
- Updated minimum required PHP version from 5.5.9 to 7.2
- Removed
ValueFormatterBase - Removed
ValueFormatterTestBase - Removed
ValueValidator::setOptions - Removed
ValueValidatorObject - Removed
DATAVALUES_INTERFACES_VERSIONconstant ValueValidators\Resultis now final- The properties of
ValueValidators\Errorare now private instead of protected
0.2.5 (2017-08-09)
- Removed MediaWiki extension credits registration
0.2.4 (2017-08-02)
- Fixed
ValueFormatterTestBasenot being installable via Composer.
0.2.3 (2017-08-02)
- Updated minimal required PHP version from 5.3 to 5.5.9.
- Minor fixes to code documentation.
- Added PHPCS support.
0.2.2 (2016-07-15)
- Fixed
ValueFormatterTestBasenot doing strict string comparisons.
0.2.1 (2016-01-13)
- Fixed an issue when using this component with HHVM 1.11.0 (see #21).
0.2.0 (2015-08-11)
- Dropped deprecated
ErrorObject, useErrorinstead - Dropped deprecated
ResultObject, useResultinstead - Dropped deprecated constant
DataValuesInterfaces_VERSION, useDATAVALUES_INTERFACES_VERSIONinstead - Dropped
ValueFormatterTestBase::getFormatterClass - Made
ValueFormatterTestBase::getInstanceabstract - The options in
ValueFormatterTestBase::getInstanceare now optional
0.1.5 (2015-02-14)
- The options in the
ValueFormatterBaseconstructor are now optional - The MediaWiki extension registration now includes the license
0.1.4 (2014-04-14)
- Added rawValue and expectedFormat arguments to
ValueParsers\ParseException
0.1.3 (2014-03-31)
- Added
ValueFormatters\FormattingException
0.1.2 (2013-11-22)
- Improved autoloading code
- Fixed link in MediaWiki credits
- Renamed entry point from DataValuesInterfaces.php to Interfaces.php
0.1.0 (2013-11-16)
Initial release with these features:
ValueFormatters\ValueFormatterinterfaceValueParsers\ValueParserinterfaceValueValidators\ValueValidatorinterface
Links
data-values/interfaces 适用场景与选型建议
data-values/interfaces 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.02M 次下载、GitHub Stars 达 8, 最近一次更新时间为 2013 年 11 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「wikidata」 「datavalues」 「valueparsers」 「valueformatters」 「valuevalidators」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 data-values/interfaces 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 data-values/interfaces 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 data-values/interfaces 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Defines the DataValue interface and some trivial implementations
Contains common implementations of the interfaces defined by DataValuesInterfaces
Common ValueValidator implementations
Geographical value objects, parsers and formatters
Serializers and deserializers for DataValue implementations
Time value objects, parsers and formatters
统计信息
- 总下载量: 1.02M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 28
- 依赖项目数: 13
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2013-11-13