-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Add more explicit nullable types for default null values #54308
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
Add more explicit nullable types for default null values #54308
Conversation
1b9edc4
to
801bc3a
Compare
src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes.php
Outdated
Show resolved
Hide resolved
1d58cbc
to
1b8ad1f
Compare
1b8ad1f
to
e9d30ba
Compare
Looks like there are more found by the CI? |
I think the remaining ones are raised by Composer and PHPUnit, which have been fixed in recent commits: composer/composer@62126e1 and sebastianbergmann/phpunit@eb22ea1 |
Thank you @alexandre-daubois. |
@@ -405,6 +406,9 @@ public function testResolveParameter() | |||
$this->assertEquals(Foo::class, $container->getDefinition('bar')->getArgument(0)); | |||
} | |||
|
|||
/** | |||
* @group legacy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this change necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test case is specifically about the deprecated syntax, testing autowiring of arguments with default value positioned before a required one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To get rid of a wanted deprecation, see #54308 (comment) for the details 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood, but why wasn't the legacy group required before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know. It is deprecated since 8.1 (https://3v4l.org/n4leq), however I wouldn't be able to explain why this warning pops now 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was not deprecated in 8.1 but has just been in 8.4. It was not deprecated because that's the only syntax that was once supported on older versions to make a type nullable.
https://3v4l.org/K8qWH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the info 👍
Continuing to bring deprecation-free support for PHP 8.4 (https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated)
If this gets merged, I'll take care of adding missing ones in upper branches if not done during upmerge 🙂