-
-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TypeDeclaration] Skip generic on ReturnTypeDeclarationRector (#2469)
* Add failing test fixture for ReturnTypeDeclarationRector # Failing Test for ReturnTypeDeclarationRector The native return type is replaced by the generic type of the pdpdoc, which does not exist. Based on https://getrector.org/demo/5a20665a-b61f-4923-8b9a-aa9cb5c3a8ea * Rename failing test * Add missing namespace * Closes #2454 Fixes rectorphp/rector#7213 * re-trigger CI Co-authored-by: François Poguet <francoispoguet@gmail.com> Co-authored-by: François Poguet <francois.poguet@quarks.pro>
- Loading branch information
1 parent
a5340c6
commit a8dae7f
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
...eDeclaration/Rector/FunctionLike/ReturnTypeDeclarationRector/Fixture/skip_generic.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\FunctionLike\ReturnTypeDeclarationRector\Fixture; | ||
|
||
class SkipGeneric | ||
{ | ||
private readonly UseCaseBusInterface $useCaseBus; | ||
|
||
/** | ||
* @template T | ||
* | ||
* @param UseCaseInterface<T> $useCase | ||
* | ||
* @return T | ||
*/ | ||
protected function execute(UseCaseInterface $useCase): mixed | ||
{ | ||
return $this->useCaseBus->execute($useCase); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters