8000 [Console][Form][FrameworkBundle][HttpKernel][PropertyInfo][Validator][WebProfilerBundle] Remove optional before required param by HypeMC · Pull Request #51778 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Console][Form][FrameworkBundle][HttpKernel][PropertyInfo][Validator][WebProfilerBundle] Remove optional before required param #51778

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
Sep 29, 2023

Conversation

HypeMC
Copy link
Member
@HypeMC HypeMC commented Sep 29, 2023
Q A
Branch? 6.4
Bug fix? no
New feature? no
Deprecations? no
Tickets -
License MIT

I'm guessing this trick was used to make arguments nullable for PHP prior to 7.1, but since Symfony now requires at least PHP 8.1 it shouldn't be necessary any more. As far as I can tell there's no breaking change: https://3v4l.org/USkgi .

There are still four places that this is used, but I believe those to be intentional test cases:

class OptionalParameter
{
public function __construct(CollisionInterface $c = null, A $a, Foo $f = null)
{
}
}

class MultipleArgumentsOptionalScalarNotReallyOptional
{
public function __construct(A $a, $foo = 'default_val', Lille $lille)
{
}
}

function reflectionParameterFixture(NotLoadableClass $arg1 = null, $arg2)
{
}

class NonExistentClassOptionalController
{
public function fooAction(NonExistentClass $nonExistent = null)
{
}
public function barAction(NonExistentClass $nonExistent = null, $bar)
{
}
}

…rtyInfo][Validator] Remove optional before required param
@carsonbot carsonbot added this to the 6.4 milestone Sep 29, 2023
@carsonbot carsonbot changed the title [FrameworkBundle][WebProfilerBundle][Console][Form][HttpKernel][PropertyInfo][Validator] Remove optional before required param [Console][Form][FrameworkBundle][HttpKernel][PropertyInfo][Validator][WebProfilerBundle] Remove optional before required param Sep 29, 2023
@nicolas-grekas
Copy link
Member

Thank you @HypeMC.

@nicolas-grekas nicolas-grekas merged commit 67e53fb into symfony:6.4 Sep 29, 2023
@HypeMC HypeMC deleted the remove-nullability-hack branch September 29, 2023 20:02
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.

4 participants
0