Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[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

Merged
merged 1 commit into from
Oct 28, 2016

Conversation

yceruto
Copy link
Member

@yceruto yceruto commented Oct 26, 2016

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] )
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

After optimization of DoctrineChoiceLoader (86b2ff1 in #18359) this code died :)

@yceruto yceruto changed the base branch from master to 3.1 October 26, 2016 17:05
@yceruto yceruto force-pushed the doctrine-bridge/remove-dead-code branch from 7db5058 to 9b49723 Compare October 26, 2016 17:15
@@ -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)
Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Member Author

@yceruto yceruto Oct 26, 2016

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

Copy link
Member Author

@yceruto yceruto Oct 26, 2016

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.

Copy link
Contributor

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

@HeahDude
Copy link
Contributor

Thanks @yceruto, good catch!

Status: Reviewed

@fabpot
Copy link
Member

fabpot commented Oct 28, 2016

Thank you @yceruto.

@fabpot fabpot merged commit 9b49723 into symfony:3.1 Oct 28, 2016
fabpot added a commit that referenced this pull request Oct 28, 2016
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
@yceruto yceruto deleted the doctrine-bridge/remove-dead-code branch November 15, 2016 21:02
fabpot added a commit that referenced this pull request Feb 1, 2017
…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
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.