Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
0931007 toc016761Compare| ); | ||
| } | ||
| publicfunctiongetPrivatePublicDefinitions() |
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.
make static?
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.
what for? it's phpunit dataprovider
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.
avoids needing to create instance of test case to invoke
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.
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.
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.
omnilightJun 13, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
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( |
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.
Should be one line to be consistent with the code base.
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.
Fixed
| /** | ||
| * @dataProvider getPrivatePublicDefinitions | ||
| */ | ||
| publicfunctiontestCorrectPublicPrivateInstantiation(Definition$definition,string$access) |
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 hate to be picky, but what doesn it mean "correct" in this context?
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.
Changed name
c016761 toa4ba66fComparestof commentedJun 13, 2018
The issue is not the method name. It is the |
stof commentedJun 13, 2018
And this needs to be fixed in 3.4, to account for ProxyManagerBridge and DependencyInjection being installed at different versions. |
stof commentedJun 13, 2018
@nicolas-grekas can you confirm my diagnosis ? |
omnilight commentedJun 13, 2018
Ok, so probably it is better just to remove checking for method existence and look only on service public or not? |
omnilight commentedJun 13, 2018
And maybe check for the version... |
stof commentedJun 14, 2018
Well, this |
omnilight commentedJun 14, 2018
Ok,@stof than we probably can check for both methods |
stof commentedJun 14, 2018
Why checking for both methods ? We only need to check for a methodremoved in 4.0. |
a4ba66f to90dd156Compare90dd156 to198bee0Comparenicolas-grekas commentedJun 14, 2018
I rebased your branch on 3.4 and pushed it on your fork. Status: needs review |
nicolas-grekas commentedJun 15, 2018
Good catch, thanks@omnilight. |
…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
stof commentedJun 29, 2018
@nicolas-grekas this patch is broken, because |
fabpot commentedJul 12, 2018
Shall we revert? |
nicolas-grekas commentedJul 12, 2018
I don't have the reference at hand, but it's already fixed. |
stof commentedJul 20, 2018
For reference, it is#27776 |
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