- The PHP minimum version is 7.2
- Typehints and
strict_types
are used everywhere allowed by PHP 7.2, so most of the method signatures are different. - XML Element name, rel name, attribute names can not use expression language anymore.
Hateoas\Configuration\Metadata\ClassMetadataInterface::addRelationProvider()
has been removed.
Relations can not be added a runtime anymore.To add a relation please use the@RelationProvider
annotation or (similar YAML/XML config) that will allow you to add relations at compile time, an example can be found here- The use of classes in
Hateoas\Representation\*
is discouraged and deprecations are expected in the next release. Suggested implementing own DTO/ValueObjects/Typed-collections to represent collections. Hateoas\Configuration\Provider\RelationProviderInterface::getRelations()
method has a new signature, previously had access to$object
(the object being serialized), now relations can be added only depending on the class. An example can be found here.- The expression function
link
and theHateoas\Helper\LinkHelper::getLinkHref
methods will throw anRuntimeException
exception if the requested link is not available (the previous behaviour was to returnnull
). Hateoas\Configuration\Provider\*
classes and interfaces have been moved one level up in the namespace (inHateoas\Configuration
)
(this change should affect only users who have implemented their own runtime relation providers).Hateoas\Configuration\Provider\Resolver\*
andHateoas\Configuration\RelationsRepository
classes have been removed, now@RelationProvider
has full access to the expression language syntax. As example:@Hateoas\RelationProvider("expr(service('foo').getExtraRelations())")
. Because of thisHateoas\HateoasBuilder::addRelationProviderResolver
has been removed.
(this change should affect only users who have implemented their own runtime relation providers).Hateoas\Expression\ExpressionFunctionInterface
has been removed. This library uses now directly the jms/serializer provided expression language. Because of thisHateoas\HateoasBuilder::registerExpressionFunction
has been removed.
(this is a change of the hateoas internals and should affect only few users who have implemented their own expression language).Hateoas\Representation\*
classes are deprecated, recommended user-land implementations.- The interface
Hateoas\Serializer\JMSSerializerMetadataAwareInterface
has been removed, inline deferrers can access the jms metadata factory via$context
argument
(this is a change of the hateoas internals and should affect only few users who have implemented their own deferrer). - The interface
Hateoas\Serializer\XmlSerializerInterface
andHateoas\Serializer\JsonSerializerInterface
have been replaced by a single interfaceHateoas\Serializer\SerializerInterface
(the two interface had the same propose)
(this is a change of the hateoas internals and should affect only few users who have implemented their own serializer). - The event subscribers
Hateoas\Serializer\EventSubscriber\JsonEventSubscriber
andHateoas\Serializer\EventSubscriber\XmlEventSubscriber
have been replaced by the event listenerHateoas\Serializer\AddRelationsListener
(the two implementations had the same propose)
(this is a change of the hateoas internals and should affect only few users who have implemented their own event subscriber).