Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Miscellaneous value objects, parsers and formatters

License

NotificationsYou must be signed in to change notification settings

DataValues/Common

Repository files navigation

DataValues Common is a small library built on top of DataValues that provides commonimplementations of the DataValues, ValueParsers, ValueFormatters, and ValueValidators interfaces.

It is part of theDataValues set of libraries.

Build StatusCode Coverage

OnPackagist:Latest Stable VersionDownload count

Installation

The recommended way to use this library is viaComposer.

To add this package as a local, per-project dependency to your project, simply add adependency ondata-values/common to your project'scomposer.json file.Here is a minimal example of acomposer.json file that just defines a dependency onversion 1.x of this package:

{    "require": {        "data-values/common": "^1.1.0"    }}

Tests

This library comes with a set up PHPUnit tests that cover all non-trivial code. You can run thesetests using the PHPUnit configuration file found in the root directory. The tests can also be runvia Github Actions.

Running the tests

For tests only

composer test

For style checks only

composer cs

For a full CI run

composer ci

Authors

DataValues Common has been written by the Wikidata team, asWikimedia Germanyemployees for theWikidata project.

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 currentmediawiki/mediawiki-codesniffer version (45.0.0)
  • Added testing with PHP 8.1 up to 8.4

1.1.0 (2022-10-21)

  • Improved compatibility with PHP 8.1;in particular, the new__serialize/__unserialize methods are implemented now(in addition to the still supportedSerializable interface).Make sure to also usedata-values/data-values version 3.1.0 (or later) to keep hashes stable.

1.0.0 (2021-01-22)

  • Updated minimum required PHP version from 5.5.9 to 7.2
  • Added compatibility withdata-values/data-values 3.x
  • Added compatibility withdata-values/interfaces 1.x
  • Removed theDATAVALUES_COMMON_VERSION constant
  • DeprecatedgetSortKey methods fromDataValue implementations
  • Classes in theValueParsers\Test namespace are now package private. NotablyValueParserTestBase andStringValueParserTest
  • TheStringFormatter constructor does not accept options any more
  • StringParser::parse now throws aParseException instead of anInvalidArgumentException
  • AddedTrimmingStringNormalizer
  • MadeFORMAT_NAME constants in the Parser classes private

0.4.3 (2019-06-28)

  • Fixed typo in error message inDispatchingValueParser

0.4.2 (2018-08-16)

  • The component can now be installed together with DataValues 2.x

0.4.1 (2017-08-09)

  • Fixed version number not updated before.

0.4.0 (2017-08-09)

  • DeprecatedMonolingualTextValue::newFromArray andMultilingualTextValue::newFromArray
  • MismatchingDataValueTypeException no longer modifies custom error messages in its constructor
  • Updated minimal required PHP version from 5.3 to 5.5.9
  • Updated the MediaWiki entry point to use the extension.json format

0.3.1 (2015-08-14)

  • The component can now be installed together with DataValues Interfaces 0.1.5

0.3.0 (2015-08-11)

  • AddedDispatchingValueParser
  • AddedStringNormalizer interface
  • AddedNullStringNormalizer
  • AddedStringParser
  • Dropped deprecated constantDataValuesCommon_VERSION, useDATAVALUES_COMMON_VERSION instead
  • DroppedValueParserTestBase::getParserClass
  • DroppedValueParserTestBase::newParserOptions
  • MadeValueParserTestBase::getInstance abstract
  • MadeValueParserTestBase::invalidInputProvider abstract
  • Lowered visibility of all class fields to private

0.2.3 (2014-10-09)

  • IntroducedFORMAT_NAME class constants on ValueParsers in order to use them as expectedFormat
  • Changed ValueParsers to pass rawValue and expectedFormat arguments when constructing aParseException
  • Installation together with DataValues 1.x is now supported

0.2.2 (2014-04-11)

  • AddedMismatchingDataValueTypeException

0.2.1 (2014-03-12)

  • Minor code cleanup
  • Improved PHPUnit bootstrap

0.2.0 (2013-12-16)

  • Added FloatParser (moved from data-values/number)
  • Added IntParser (moved from data-values/number)

0.1.1 (2013-11-22)

  • Fixed link in the MediaWiki credits

0.1.0 (2013-11-17)

Initial release with these features:

  • Several DataValue implementations
    • MonolingualTextValue
    • MultilingualTextValue
  • Several ValueFormatter implementations
    • StringFormatter
  • Several ValueParser implementations
    • BoolParser
    • DecimalParser
    • NullParser

Links

About

Miscellaneous value objects, parsers and formatters

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors21

Languages


[8]ページ先頭

©2009-2025 Movatter.jp