All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning and this changelog format.
- New static
AbstractValue::nullable()
method. This casts the provided value to the value object, unless it isnull
.
- Package tests are now run using Github actions instead of Travis.
- Removed deprecation message on
jsonSerialize()
return type for PHP 8.1. - Fixed the argument type in the docblock for
ValueTrait::is()
andValueInterface::is()
.
- Package now supports PHP 8.
This package now requires PHP 7.1 or above.
- Added PHP 7 return types to interface, trait and abstract class methods.
- No longer support PHP 5.6 and 7.0.
- Deprecated mutable value objects have been removed.
- Removed the
isAny
method in favour ofis
.
- 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.
- Mutable value objects are deprecated and will be removed in 2.0
- 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 ofstatic
.
- Minimum PHP version is now
5.6.0
. ValueException
now extendsInvalidArgumentException
.