Skip to content

Add some typehint on controller as service #18305

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

Merged
merged 1 commit into from
May 19, 2023
Merged

Conversation

94noni
Copy link
Contributor

@94noni 94noni commented May 12, 2023

while reading this page, found it can be better to showcase strong typehint

@carsonbot carsonbot added this to the 5.4 milestone May 12, 2023
@94noni 94noni changed the title Add some typehint Add some typehint on controller as service May 12, 2023
@@ -228,14 +230,14 @@ service and use it directly::

class HelloController
{
private $twig;
private Environment $twig;

public function __construct(Environment $twig)
Copy link
Contributor

Choose a reason for hiding this comment

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

could be refactored to constructor property promotion in 6.2 after merge

Copy link
Contributor

Choose a reason for hiding this comment

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

It was already done in 6.2

@OskarStark
Copy link
Contributor

Thank you Antoine.

@OskarStark OskarStark merged commit b468323 into symfony:5.4 May 19, 2023
@94noni 94noni deleted the patch-10 branch May 20, 2023 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants