Skip to content

Commit 8370ad6

Browse files
committed
minor symfony#60068 [ObjectMapper] rename variable $object to $source (soyuka)
This PR was merged into the 7.3 branch. Discussion ---------- [ObjectMapper] rename variable $object to $source | Q | A | ------------- | --- | Branch? | 7.3 | New feature? | no | Deprecations? | no | License | MIT also adds cs fixes Commits ------- c0b7ecf [ObjectMapper] rename variable $object to $source
2 parents f1e169e + c0b7ecf commit 8370ad6

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

src/Symfony/Component/ObjectMapper/ConditionCallableInterface.php

Lines changed: 2 additions & 2 deletions
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
}

src/Symfony/Component/ObjectMapper/Tests/Fixtures/ClassWithoutTarget.php

Lines changed: 9 additions & 0 deletions
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

src/Symfony/Component/ObjectMapper/Tests/ObjectMapperTest.php

Lines changed: 2 additions & 2 deletions
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
}

src/Symfony/Component/ObjectMapper/TransformCallableInterface.php

Lines changed: 2 additions & 2 deletions
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)