Skip to content

Add AbstractController as base class if no one exists#2223

Merged
TomasVotruba merged 2 commits intorectorphp:masterfrom
stedekay:without-base-class
Oct 31, 2019
Merged

Add AbstractController as base class if no one exists#2223
TomasVotruba merged 2 commits intorectorphp:masterfrom
stedekay:without-base-class

Conversation

@stedekay
Copy link
Copy Markdown
Contributor

@stedekay stedekay commented Oct 30, 2019

This is a first draft to fix #2215.

It seems to work, but I get an error from PHPStan which I don't understand.
Maybe you can help me with that?

Copy link
Copy Markdown
Member

@TomasVotruba TomasVotruba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good first draft, wow!

Just one more check and it's ready

Comment thread packages/Sensio/src/Rector/FrameworkExtraBundle/TemplateAnnotationRector.php Outdated
@stedekay
Copy link
Copy Markdown
Contributor Author

There is one more thing I thought about. What if the controller is extending a class which is not based on AbstractController, like:

class MyController extends DefaultController {
}

class DefaultController {
}

In this case, the render method would be added, but still failing as its missing.

@TomasVotruba
Copy link
Copy Markdown
Member

Agreed. Should we skip such case?
U wonder how real it is and if it's worth the attention

@stedekay
Copy link
Copy Markdown
Contributor Author

Exactly, I think it is something which can be skipped for now. Can be fixed when its needed :)

@TomasVotruba TomasVotruba merged commit 5783fe4 into rectorphp:master Oct 31, 2019
@TomasVotruba
Copy link
Copy Markdown
Member

Thank you

@stedekay stedekay deleted the without-base-class branch October 31, 2019 14:39
TomasVotruba added a commit that referenced this pull request May 4, 2022
rectorphp/rector-src@6327904 [CodingStyle] Skip override parent method on UnSpreadOperatorRector (#2223)
TomasVotruba added a commit that referenced this pull request May 4, 2022
rectorphp/rector-src@6327904 [CodingStyle] Skip override parent method on UnSpreadOperatorRector (#2223)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Edge Cases with TemplateAnnotationRector

2 participants