Package containing the interfaces and abstract implementations to support the usage of Value objects in packages and projects.

Maintainers

👁 zero2one

Package info

github.com/district09/php_package_dg-value

pkg:composer/digipolisgent/value

Statistics

Installs: 91 994

Dependents: 6

Suggesters: 0

Stars: 0

Open Issues: 0

3.0.0 2022-08-17 07:50 UTC

Requires

  • php: ^7.4 || ^8.0

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 7b60020169b0bf901456d877af204b708a4c19ae

  • Peter Decuyper <peter.decuyper.woop@distict09.gent>

Value Objectdigipolisgentdistrict09

This package is auto-updated.

Last update: 2026-06-17 16:33:31 UTC


README

Package containing the interfaces and abstract implementations to support the usage of Value objects in other packages and projects.

👁 Latest Stable Version
👁 Total Downloads
👁 License

👁 Build Status
👁 Maintainability
👁 Test Coverage
👁 PHP from Packagist

Usage

This package contains the following interfaces:

  • ValueInterface : the basic interface for all value objects.
  • ValueFromArrayInterface : extra interface that adds, to a value object, the static method to create it from an array of data.
  • ValueToArrayInterface : extra interface that adds, to a value object, the method to extract its data as an array.
  • CollectonInterface : the basic interface for a collection of values of the same type.

And the following abstract implementations:

  • ValueAbstract : Abstract implementation of the ValueInterface, implements only the sameValueTypeAs() method.
  • CollectionAbstract : Abstract implementation of the CollectonInterface, implements the method to compare two collections (sameValueAs()) and to get the collection as an iterator (getIterator()).

Install

Install the package:

composer require digipolisgent/value

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

Run the test suite:

vendor/bin/phpunit

License

The MIT License (MIT). Please see License File for more information.