Skip to content

Commit 1f39e5e

Browse files
minor #48079 Fix the DataTransformerInterface generic types to support the patcher (stof)
This PR was merged into the 6.2 branch. Discussion ---------- Fix the DataTransformerInterface generic types to support the patcher | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | n/a The type patcher adding return types handles template types only for methods that already have a return type. As `DataTransformerInterface` is not typed yet in Symfony 6.x, we need to keep the future native types in ``@return`` for the patcher tool. This puts the generic type (introduced in #47412) in ``@psalm`-return`, as done in #48012 (I detected this issue when regenerating the return type for that other PR) Commits ------- d9fd5c71ad Fix the DataTransformerInterface generic types to support the patcher
2 parents 2d867d6 + e8e7062 commit 1f39e5e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

DataTransformerInterface.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ interface DataTransformerInterface
5858
*
5959
* @param TValue|null $value The value in the original representation
6060
*
61-
* @return TTransformedValue|null
61+
* @return mixed
62+
*
63+
* @psalm-return TTransformedValue|null
6264
*
6365
* @throws TransformationFailedException when the transformation fails
6466
*/
@@ -87,7 +89,9 @@ public function transform(mixed $value);
8789
*
8890
* @param TTransformedValue|null $value The value in the transformed representation
8991
*
90-
* @return TValue|null
92+
* @return mixed
93+
*
94+
* @psalm-return TValue|null
9195
*
9296
* @throws TransformationFailedException when the transformation fails
9397
*/

0 commit comments

Comments
 (0)