Skip to content

Latest commit

 

History

History
82 lines (50 loc) · 2.33 KB

File metadata and controls

82 lines (50 loc) · 2.33 KB

Change Log

All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning and this changelog format.

Unreleased

[3.0.0] - 2025-09-12

Changed

  • Minimum PHP version is now 8.2.
  • Added generics to the value interface, abstract class and trait. This will be breaking if you are running PHPStan.
  • BREAKING: The abstract value and value trait are now both readonly. This is because value objects should always be immutable.
  • BREAKING: The abstract value constructor is now final. If you need to parse the provided value before it is accepted, overload the parse() method in your class. Alternatively, don't extend the AbstractValue and use the ValueTrait instead.

[2.2.0] - 2022-03-04

Added

  • New static AbstractValue::nullable() method. This casts the provided value to the value object, unless it is null.

Changed

  • Package tests are now run using Github actions instead of Travis.

Fixed

  • Removed deprecation message on jsonSerialize() return type for PHP 8.1.
  • Fixed the argument type in the docblock for ValueTrait::is() and ValueInterface::is().

[2.1.0] - 2021-01-27

Added

  • Package now supports PHP 8.

[2.0.0] - 2018-06-11

This package now requires PHP 7.1 or above.

Changed

  • Added PHP 7 return types to interface, trait and abstract class methods.

Removed

  • No longer support PHP 5.6 and 7.0.
  • Deprecated mutable value objects have been removed.
  • Removed the isAny method in favour of is.

[1.2.0] - 2017-08-24

Added

  • The following methods have been added to value objects:
    • toString for fluently casting the object to a string.
    • isAny to check if the value is one of any number of provided values.
    • isEmpty to check if the value is empty.
    • isNotEmpty to check if the value is not empty.

Deprecated

  • Mutable value objects are deprecated and will be removed in 2.0

[1.1.0] - 2017-07-25

Added

  • The following static methods have been added to both abstract classes:
    • create which is a fluent constructor.
    • cast which ensures the provided value is an instance of static.

[1.0.0] - 2017-01-30

Changed

  • Minimum PHP version is now 5.6.0.
  • ValueException now extends InvalidArgumentException.