Skip to content

Commit 27e9bed

Browse files
committed
[ObjectMapper] rename variable $object to $source
also adds cs fixes
1 parent 61c7902 commit 27e9bed

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

ConditionCallableInterface.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface ConditionCallableInterface
2424
{
2525
/**
2626
* @param mixed $value The value being mapped
27-
* @param T $object The object we're working on
27+
* @param T $source The object we're working on
2828
*/
29-
public function __invoke(mixed $value, object $object): bool;
29+
public function __invoke(mixed $value, object $source): bool;
3030
}

Tests/Fixtures/ClassWithoutTarget.php

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\Component\ObjectMapper\Tests\Fixtures;
413

514
class ClassWithoutTarget

Tests/ObjectMapperTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public function testServiceLocator()
194194

195195
protected function getServiceLocator(array $factories): ContainerInterface
196196
{
197-
return new class ($factories) implements ContainerInterface {
197+
return new class($factories) implements ContainerInterface {
198198
public function __construct(private array $factories)
199199
{
200200
}
@@ -244,7 +244,7 @@ public function testTransformToWrongValueType()
244244
$u->foo = 'bar';
245245

246246
$metadata = $this->createStub(ObjectMapperMetadataFactoryInterface::class);
247-
$metadata->method('create')->with($u)->willReturn([new Mapping(target: \stdClass::class, transform: fn() => 'str')]);
247+
$metadata->method('create')->with($u)->willReturn([new Mapping(target: \stdClass::class, transform: fn () => 'str')]);
248248
$mapper = new ObjectMapper($metadata);
249249
$mapper->map($u);
250250
}

TransformCallableInterface.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface TransformCallableInterface
2424
{
2525
/**
2626
* @param mixed $value The value being mapped
27-
* @param T $object The object we're working on
27+
* @param T $source The object we're working on
2828
*/
29-
public function __invoke(mixed $value, object $object): mixed;
29+
public function __invoke(mixed $value, object $source): mixed;
3030
}

0 commit comments

Comments
 (0)