data-values/data-values
Defines the DataValue interface and some trivial implementations
Requires
- php: >=5.5.9
Requires (Dev)
- phpunit/phpunit: ~4.8
- wikibase/wikibase-codesniffer: ^0.1.0
Replaces
- mediawiki/data-values: *
README
DataValues is a small PHP library that aims to be a common foundation for representing "simple" values. Values such as booleans and strings.
It is part of the DataValues set of libraries.
On Packagist:
Requirements
These PHP versions are supported:
- PHP 5.5 or later, including PHP 7
- HHVM 3.3 or later
Installation
To add this package as a local, per-project dependency to your project, simply add a
dependency on data-values/data-values to your project's composer.json file.
Here is a minimal example of a composer.json file that just defines a dependency on
DataValues 2.0:
{
"require": {
"data-values/data-values": "^2.0.0"
}
}
Running the tests
For tests only
composer test
For style checks only
composer cs
For a full CI run
composer ci
Authors
DataValues has been written primarily by Jeroen De Dauw, in part as Wikimedia Germany employee for the Wikidata project.
Contributions where also made by [several other awesome people] (https://www.ohloh.net/p/datavalues/contributors).
Release notes
2.2.0 (dev)
- Deprecated
DATAVALUES_VERSIONconstant
2.1.1 (2017-09-28)
- Fixed
DataValueTestnot being installable via Composer
2.1.0 (2017-08-09)
- Removed MediaWiki integration
2.0.0 (2017-08-02)
- Dropped
Copyableinterface - Dropped deprecated constant
DataValues_VERSION, useDATAVALUES_VERSIONinstead - Deprecated
newFromArrayin allDataValueimplementations. - Updated minimal required PHP version from 5.3 to 5.5.9
- Updated documentation throughout the code
1.1.1 (2017-11-02)
- Add .gitattributes file
1.1.0 (2017-08-09)
- Remove MediaWiki integration
1.0.0 (2014-09-26)
- The CI now ensures compatibility with PHP 5.6 and HHVM
- A lot of type hints where improved
- Protected methods and fields where changed to private
- The test bootstrap no longer executes
composer update - The test bootstrap now sets PHP strict mode
- The contract of the
Hashable::getHashmethod was updated - The MediaWiki internationalization support has been migrated to the JSON based version
0.1.1 (2013-11-22)
- Removed support for running the tests via the MediaWiki test runner.
- The test bootstrapping file now automatically does a composer install.
- Removed custom autoloader in favour of defining autoloading in composer.json.
0.1.0 (2013-11-16)
Initial release with these features:
- DataValue interface
- BooleanValue implementation
- NumberValue implementation
- StringValue implementation
- UnDeserializableValue implementation
- UnknownValue implementation
- Common interface definitions: Comparable, Copyable, Hashable, Immutable