Skip to content

Commit 34528ce

Browse files
soyukanorkunasOskarStark
authored
Apply suggestions from code review
Co-authored-by: Tomas Norkūnas <norkunas.tom@gmail.com> Co-authored-by: Oskar Stark <oskarstark@googlemail.com>
1 parent 33f1f4b commit 34528ce

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

object-mapper.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Configure property mapping
7878

7979
Use the :class:`Symfony\\Component\\ObjectMapper\\Attribute\\Map` attribute on properties to configure property mapping between
8080
objects. ``target`` changes the target property, ``if`` allows to
81-
conditionnally map properties::
81+
conditionally map properties::
8282

8383
// src/Dto/Source.php
8484
namespace App\Dto;
@@ -97,9 +97,9 @@ Transform mapped values
9797
-----------------------
9898

9999
Use ``transform`` to call a function or a
100-
:class:`Symfony\Component\ObjectMapper\CallableInterface`::
100+
:class:`Symfony\\Component\\ObjectMapper\\CallableInterface`::
101101

102-
// src/ObjectMapper/TransformNameCallable
102+
// src/ObjectMapper/TransformNameCallable.php
103103
namespace App\ObjectMapper;
104104

105105
use App\Dto\Source;
@@ -157,7 +157,8 @@ classes and it can be repeated::
157157

158158
#[Map(target: B::class, if: [Source::class, 'shouldMapToB'])]
159159
#[Map(target: C::class, if: [Source::class, 'shouldMapToC'])]
160-
class Source {
160+
class Source
161+
{
161162
public static function shouldMapToB(mixed $value, object $object): bool
162163
{
163164
return false;
@@ -248,13 +249,12 @@ With this metadata usage, the mapping definition belongs to a mapper class::
248249
}
249250

250251

251-
The custom metadata is injected inside our :class:`Symfony\\Component\\ObjectMapper\\ObjectMapperInterface`::
252+
The custom metadata is injected into our :class:`Symfony\\Component\\ObjectMapper\\ObjectMapperInterface`::
252253

253254
$a = new Source('a', 'b', 'c');
254255
$metadata = new MapStructMapperMetadataFactory(AToBMapper::class);
255256
$mapper = new ObjectMapper($metadata);
256257
$aToBMapper = new AToBMapper($mapper);
257258
$b = $aToBMapper->map($a);
258259

259-
260260
.. _`MapStruct`: https://mapstruct.org/

0 commit comments

Comments
 (0)