diff --git a/object-mapper.rst b/object-mapper.rst index 046649cfabf..5a72be3b793 100644 --- a/object-mapper.rst +++ b/object-mapper.rst @@ -17,7 +17,7 @@ Run this command to install the ``object-mapper`` before using it: Using the ObjectMapper Service ------------------------------ -Once enabled, the object mapper service can be injected in any service where +Once installed, the object mapper service can be injected in any service where you need it or it can be used in a controller:: // src/Controller/DefaultController.php @@ -96,7 +96,7 @@ conditionally map properties:: Transform mapped values ----------------------- -Use ``transform`` to call a function or a +Use ``transform`` to call a static function or a :class:`Symfony\\Component\\ObjectMapper\\CallableInterface`:: // src/ObjectMapper/TransformNameCallable.php @@ -131,7 +131,7 @@ Use ``transform`` to call a function or a } -The ``if`` and ``transform`` parameters also accept callbacks:: +The ``if`` and ``transform`` parameters also accept static callbacks:: // src/Dto/Source.php namespace App\Dto; @@ -172,7 +172,7 @@ classes and it can be repeated:: Provide your own mapping metadata --------------------------------- -The :class:`Symfony\\Component\\ObjectMapper\\MapperMetadataFactoryInterface` allows +The :class:`Symfony\\Component\\ObjectMapper\\ObjectMapperMetadataFactoryInterface` allows to change how mapping metadata is computed. With this interface we can create a `MapStruct`_ version of the Object Mapper:: @@ -180,14 +180,14 @@ to change how mapping metadata is computed. With this interface we can create a namespace App\Metadata\ObjectMapper; use Symfony\Component\ObjectMapper\Attribute\Map; - use Symfony\Component\ObjectMapper\Metadata\MapperMetadataFactoryInterface; + use Symfony\Component\ObjectMapper\Metadata\ObjectMapperMetadataFactoryInterface; use Symfony\Component\ObjectMapper\Metadata\Mapping; use Symfony\Component\ObjectMapper\ObjectMapperInterface; /** * A Metadata factory that implements the basics behind https://mapstruct.org/. */ - final class MapStructMapperMetadataFactory implements MapperMetadataFactoryInterface + final class MapStructMapperMetadataFactory implements ObjectMapperMetadataFactoryInterface { public function __construct(private readonly string $mapper) {