Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fd55ff0

Browse filesBrowse files
committed
review mtarld
1 parent 1910509 commit fd55ff0
Copy full SHA for fd55ff0

File tree

4 files changed

+8
-7
lines changed
Filter options

4 files changed

+8
-7
lines changed

‎src/Symfony/Component/ObjectMapper/Condition/TargetClass.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/ObjectMapper/Condition/TargetClass.php
+4-3
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313

1414
use Symfony\Component\ObjectMapper\ConditionCallableInterface;
1515

16-
1716
/**
18-
* @implements ConditionCallableInterface<object, object>
17+
* @template T of object
18+
*
19+
* @implements ConditionCallableInterface<object, T>
1920
*/
2021
final class TargetClass implements ConditionCallableInterface
2122
{
2223
/**
23-
* @param class-string $className
24+
* @param class-string<T> $className
2425
*/
2526
public function __construct(private readonly string $className)
2627
{

‎src/Symfony/Component/ObjectMapper/ObjectMapper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/ObjectMapper/ObjectMapper.php
+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function map(object $source, object|string|null $target = null): object
5050
}
5151

5252
$metadata = $this->metadataFactory->create($source);
53-
$map = $this->getMapTarget($metadata, null, $source);
53+
$map = $this->getMapTarget($metadata, null, $source, null);
5454
$target ??= $map?->target;
5555
$mappingToObject = \is_object($target);
5656

@@ -228,7 +228,7 @@ private function call(callable $fn, mixed $value, object $source, ?object $targe
228228
/**
229229
* @param Mapping[] $metadata
230230
*/
231-
private function getMapTarget(array $metadata, mixed $value, object $source, ?object $target = null): ?Mapping
231+
private function getMapTarget(array $metadata, mixed $value, object $source, ?object $target): ?Mapping
232232
{
233233
$mapTo = null;
234234
foreach ($metadata as $mapAttribute) {

‎src/Symfony/Component/ObjectMapper/Tests/Fixtures/ServiceLocator/ConditionCallable.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/ObjectMapper/Tests/Fixtures/ServiceLocator/ConditionCallable.php
+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
class ConditionCallable implements ConditionCallableInterface
2020
{
21-
public function __invoke(mixed $value, object $source, ?object $target = null): bool
21+
public function __invoke(mixed $value, object $source, ?object $target): bool
2222
{
2323
return 'ok' === $value;
2424
}

‎src/Symfony/Component/ObjectMapper/Tests/Fixtures/ServiceLocator/TransformCallable.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/ObjectMapper/Tests/Fixtures/ServiceLocator/TransformCallable.php
+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
class TransformCallable implements TransformCallableInterface
2020
{
21-
public function __invoke(mixed $value, object $source, ?object $target = null): mixed
21+
public function __invoke(mixed $value, object $source, ?object $target): mixed
2222
{
2323
return "transformed$value";
2424
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.