On Packagist:
You can use Composer to download and install this package as well as its dependencies. Alternatively you can simply clone the git repository and take care of loading yourself.
To add this package as a local, per-project dependency to your project, simply add a dependency on data-values/data-types
to your project's composer.json
file. Here is a minimal example of a composer.json
file that just defines a dependency on DataTypes 1.0:
{ "require": { "data-values/data-types": "~1.0" } }
Get the DataTypes code, either via git, or some other means. Also get all dependencies. You can find a list of the dependencies in the "require" section of the composer.json file. Load all dependencies and the load the DataTypes library by including its entry point: DataTypes.php.
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 TravisCI, as a TravisCI configuration file is also provided in the root directory.
DataTypes has been written by the Wikidata team at Wikimedia Germany for the Wikidata project.
DataTypesModules
DataType
and DataTypeFactory
do not accept empty strings any more.DataType::getLabel
along with the DataTypes\Message
class.DataType::getMessageKey
.composer phpcs
.DataTypesModule
.DataTypeFactory
to report invalid arguments on construction.DataTypeFactory::getTypes()
now returns array with typeId keys as documentedDataType
no longer takes an array of ValueValidator
in its constructorDataType::getValidators
has been removedDataTypeFactory
now takes a map from data type id to data value type.DataTypeFactory::registerBuilder
has been removedvendor
rather than extensions
wgDataTypes
monolingual-text
to monolingualtext
multilingual-text
to multilingualtext
dataTypes.DataType
JavaScript object may no longer be initialized from a dataValues.DataValue
object.dataTypes.DataType.getLabel
.dataTypes
object; DataTypeStore
is to be used instead.Initial release.