-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DoctrineBridge] Remove dead code in DoctrineType #20312
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
Conversation
7db5058
to
9b49723
Compare
@@ -108,15 +99,9 @@ public function getQueryBuilderPartsForCachingHash($queryBuilder) | ||
return false; | ||
} | ||
|
||
public function __construct(ManagerRegistry $registry, PropertyAccessorInterface $propertyAccessor = null, ChoiceListFactoryInterface $choiceListFactory = null) | ||
public function __construct(ManagerRegistry $registry) |
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 think we should remove this since it would be a BC break for anyone using the Form component and the DoctrineBridge without the full stack.
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.
A BC break for people doing weird things too as says @stof :D
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.
Anyway this is an abstract class and we can't do that change.
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 is not a BC break because PHP does not care about additional arguments that you pass to constructor/methods. Checks this http://symfony.com/doc/current/contributing/code/bc.html#id13
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.
Given a class that extends of DoctrineType
(currently) if the __constructor()
was overwritten would look like this:
public function __construct(ManagerRegistry $registry, PropertyAccessorInterface $propertyAccessor = null, ChoiceListFactoryInterface $choiceListFactory = null, $extraData = null)
{
parent::__constructor($registry, $propertyAccessor, $choiceListFactory);
$this->extraData = $extraData;
}
It doesn't break after this PR.
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.
Ok after all it's private method
Thanks @yceruto, good catch! Status: Reviewed |
Thank you @yceruto. |
This PR was merged into the 3.1 branch. Discussion ---------- [DoctrineBridge] Remove dead code in DoctrineType | Q | A | ------------- | --- | Branch? | 3.1 | Bug fix? | no | New feature? | no | BC breaks? | no (Only the last arguments of a method may be removed [[3]](http://symfony.com/doc/current/contributing/code/bc.html#id13) ) | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - After optimization of DoctrineChoiceLoader (86b2ff1 in #18359) this code died :) Commits ------- 9b49723 remove dead code
…n (yceruto) This PR was submitted for the master branch but it was merged into the 3.2 branch instead (closes #21493). Discussion ---------- [DoctrineBridge] Remove dead code in DoctrineOrmExtension | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT After optimization in #20312 and #18359 Commits ------- 0cd8bf8 Remove dead code
After optimization of DoctrineChoiceLoader (86b2ff1 in #18359) this code died :)