Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[ProxyManagerBridge] Fixed support of private services#27593

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@omnilight
Copy link

QA
Branch?master
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#...
LicenseMIT
Doc PR

Fixed lazy loading of private services, that was broken since Symfony 4.0 release because of renaming
addObjectResource
https://github.com/symfony/symfony/blame/fa022f05be75aacc8afcdc11b63333685c719e13/src/Symfony/Component/DependencyInjection/CHANGELOG.md#L114

);
}

publicfunctiongetPrivatePublicDefinitions()
Copy link
Contributor

Choose a reason for hiding this comment

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

make static?

Copy link
Contributor

Choose a reason for hiding this comment

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

what for? it's phpunit dataprovider

Copy link
Contributor

Choose a reason for hiding this comment

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

avoids needing to create instance of test case to invoke

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

https://github.com/sebastianbergmann/phpunit/blob/master/src/Util/Test.php#L840

using $this inside the data provider can be confusing if it's not static too, use of Prophecy for example isn't managed etc... it was just a minor suggestion.

Copy link
Author

@omnilightomnilightJun 13, 2018
edited
Loading

Choose a reason for hiding this comment

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

But nowhere in the Symfony tests data proiders are made static. Why must this one be?


$code =$this->dumper->getProxyFactoryCode($definition,'foo','$this->getFoo2Service(false)');

$this->assertStringMatchesFormat(
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be one line to be consistent with the code base.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

/**
* @dataProvider getPrivatePublicDefinitions
*/
publicfunctiontestCorrectPublicPrivateInstantiation(Definition$definition,string$access)
Copy link
Contributor

Choose a reason for hiding this comment

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

I hate to be picky, but what doesn it mean "correct" in this context?

Copy link
Author

Choose a reason for hiding this comment

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

Changed name

@stof
Copy link
Member

The issue is not the method name. It is the!. We want to useprivates only on 4.0 where the method is removed

@stof
Copy link
Member

And this needs to be fixed in 3.4, to account for ProxyManagerBridge and DependencyInjection being installed at different versions.

@stof
Copy link
Member

@nicolas-grekas can you confirm my diagnosis ?

@omnilight
Copy link
Author

Ok, so probably it is better just to remove checking for method existence and look only on service public or not?

@omnilight
Copy link
Author

And maybe check for the version...

@stof
Copy link
Member

Well, thismethod_exists is precisely the way we detect whether we are using DI 3.4 or 4.0. We don't have a version constant in the DI component.

@omnilight
Copy link
Author

Ok,@stof than we probably can check for both methods

@stof
Copy link
Member

Why checking for both methods ? We only need to check for a methodremoved in 4.0.

@nicolas-grekasnicolas-grekas added this to the3.4 milestoneJun 14, 2018
@nicolas-grekasnicolas-grekas changed the base branch frommaster to3.4June 14, 2018 10:03
@nicolas-grekasnicolas-grekas changed the title[DI] Fixed support of private services since Symfony 4.0[ProxyManagerBridge] Fixed support of private servicesJun 14, 2018
@nicolas-grekas
Copy link
Member

I rebased your branch on 3.4 and pushed it on your fork.
See adjusted patch.

Status: needs review

@nicolas-grekas
Copy link
Member

Good catch, thanks@omnilight.

@nicolas-grekasnicolas-grekas merged commit198bee0 intosymfony:3.4Jun 15, 2018
nicolas-grekas added a commit that referenced this pull requestJun 15, 2018
…colas-grekas)This PR was merged into the 3.4 branch.Discussion----------[ProxyManagerBridge] Fixed support of private services| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | #...| License       | MIT| Doc PR        |<!--Write a short README entry for your feature/bugfix here (replace this comment block.)This will help people understand your PR and can be used as a start of the Doc PR.Additionally: - Bug fixes must be submitted against the lowest branch where they apply   (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch.-->Fixed lazy loading of private services, that was broken since Symfony 4.0 release because of renamingaddObjectResourcehttps://github.com/symfony/symfony/blame/fa022f05be75aacc8afcdc11b63333685c719e13/src/Symfony/Component/DependencyInjection/CHANGELOG.md#L114Commits-------198bee0 [ProxyManagerBridge] Fixed support of private services
This was referencedJun 25, 2018
@stof
Copy link
Member

@nicolas-grekas this patch is broken, because$this->privates is not used to store private services in DI 3.4, only in 4.0+. So we still need a different logic in the ProxyManagerBridge based on the Symfony DI version.

@stofstof mentioned this pull requestJun 29, 2018
@fabpot
Copy link
Member

Shall we revert?

@nicolas-grekas
Copy link
Member

I don't have the reference at hand, but it's already fixed.

@stof
Copy link
Member

For reference, it is#27776

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

3 more reviewers

@rodnaphrodnaphrodnaph left review comments

@scaytrasescaytrasescaytrase left review comments

@jakzaljakzaljakzal requested changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

8 participants

@omnilight@stof@nicolas-grekas@fabpot@jakzal@rodnaph@scaytrase@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp