Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActionController ResponseInterface is always converted to FQCN #4149

Closed
eliashaeussler opened this issue Mar 7, 2024 · 0 comments · Fixed by #4170
Closed

ActionController ResponseInterface is always converted to FQCN #4149

eliashaeussler opened this issue Mar 7, 2024 · 0 comments · Fixed by #4170
Labels

Comments

@eliashaeussler
Copy link
Contributor

eliashaeussler commented Mar 7, 2024

Bug Report

Subject Details
Rector version v2.0.4 (tested with latest dev-main (acf35ad) as well)

Hi, (probably since #4036) Rector tries to change ResponseInterface to a FQCN in my controller, even if the interface is already imported as use statement:

1) Classes/Controller/JobController.php:53

    ---------- begin diff ----------
@@ @@
         protected readonly SchemaFactory $schemaFactory,
     ) {}

-    public function listAction(): ResponseInterface
+    public function listAction(): \Psr\Http\Message\ResponseInterface
     {
         $this->cacheManager->addTag();

@@ @@
         return $this->htmlResponse();
     }

-    public function showAction(Job $job): ResponseInterface
+    public function showAction(Job $job): \Psr\Http\Message\ResponseInterface
     {
         $this->cacheManager->addTag($job);
    ----------- end diff -----------

Applied rules:
 * ExtbaseControllerActionsMustReturnResponseInterfaceRector (https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/11.0/Deprecation-92784-ExtbaseControllerActionsMustReturnResponseInterface.html)
 * ReplaceInjectAnnotationWithMethodRector (https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/11.
(see https://github.com/CPS-IT/personio-jobs/actions/runs/7903793944/job/21572533386)

Minimal PHP Code Causing Issue

https://getrector.com/demo/950fb62c-9b09-482d-9eb8-fa8169a3ff8a

See workflow run: https://github.com/CPS-IT/personio-jobs/actions/runs/8188793551/job/22392070989?pr=146

Expected Behaviour

The return type shouldn't be changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant