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

[DependencyInjection] fixed service resolution for factories#13519

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
fabpot merged 1 commit intosymfony:2.3fromfabpot:resolve-factory-parameters
Mar 14, 2015

Conversation

@fabpot
Copy link
Member

QA
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#13455
LicenseMIT
Doc PRn/a

In the service container, factories can be defined with a class/method pair or a service/method pair.

The class or service value can be a container parameter, but it was not supported everywhere, this PR fixes that.

Note that the method can never be a container parameter as this is supported nowhere in the current code, so this has not been changed.

Another PR will fix the 2.6 way of configuring a factory.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

FWIW, I think it was a mistake to support this use case, but as it is, we should support it thoroughly.

@fabpotfabpotforce-pushed theresolve-factory-parameters branch from76ccf15 to5778721CompareJanuary 25, 2015 08:18
Copy link
Member

Choose a reason for hiding this comment

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

do we really need this logic here ? I don't understand the goal of the$ check changing the way to dump things.$definition->getFactoryService() will always return a service id here, given you resolve it in the compiler pass

Copy link
Member

Choose a reason for hiding this comment

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

btw, do we really need to support the case of parameters for factory services ? I does not make sense IMO. This is a use case for aliases instead.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

IIRC, it's because it's supported by the new way of defining factories. But you're right, it does not really make sense. I'm going to drop this.

@xabbuh
Copy link
Member

@fabpot@stof What is the plan with this? It would be nice to get this fix into 2.6.5 to make bundles forward-compatible.

@fabpotfabpotforce-pushed theresolve-factory-parameters branch 2 times, most recently from59b8137 tof86ad95CompareMarch 11, 2015 08:33
@fabpot
Copy link
MemberAuthor

I've removed some code, should be ready now. ping @symfony/deciders

@fabpotfabpot merged commitf86ad95 intosymfony:2.3Mar 14, 2015
fabpot added a commit that referenced this pull requestMar 14, 2015
…es (fabpot)This PR was merged into the 2.3 branch.Discussion----------[DependencyInjection] fixed service resolution for factories| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#13455| License       | MIT| Doc PR        | n/aIn the service container, factories can be defined with a class/method pair or a service/method pair.The class or service value can be a container parameter, but it was not supported everywhere, this PR fixes that.Note that the method can never be a container parameter as this is supported nowhere in the current code, so this has not been changed.Another PR will fix the 2.6 way of configuring a factory.Commits-------f86ad95 [DependencyInjection] fixed service resolution for factories
weaverryan added a commit to weaverryan/symfony that referenced this pull requestMar 14, 2015
fabpot added a commit that referenced this pull requestMar 15, 2015
This PR was merged into the 2.3 branch.Discussion----------Fixing wrong variable name from#13519| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#13519| License       | MIT| Doc PR        | n/aHi guys!I'm currently seeing an undefined variable in the `PhpDumper` on all branches. I think it was added inadvertently in#13519, so unless I'm totally missing something, this should be an easy merge.Thanks!Commits-------3ae52ed Fixing wrong variable name from#13519
fabpot added a commit that referenced this pull requestMar 15, 2015
* 2.3:  `ResolveParameterPlaceHoldersPass` unit tests  Fixing wrong variable name from#13519
fabpot added a commit that referenced this pull requestMar 15, 2015
* 2.6:  `ResolveParameterPlaceHoldersPass` unit tests  Fixing wrong variable name from#13519  [translation][initialize cache] Remove dead code.Conflicts:src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
fabpot added a commit that referenced this pull requestMar 17, 2015
…factories (xabbuh)This PR was merged into the 2.6 branch.Discussion----------[DependencyInjection] resolve class parameters in service factories| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |This is based on the parameter resolving for factories from#13519 and makes the necessary changes for the new factory syntax introduced in Symfony 2.6.@fabian In#13519, you also updated the `PhpDumper` to make use of `dumpValue()`. Should I do the same here (or in this case reopen#13455)?Commits-------8bda37c resolve class parameters in service factories
fabpot added a commit that referenced this pull requestMar 17, 2015
* 2.7:  `ResolveParameterPlaceHoldersPass` unit tests  Fixing wrong variable name from#13519  [translation][initialize cache] Remove dead code.  [DependencyInjection] fixed service resolution for factories  [HttpKernel] Throw a LogicException when kernel.exception does not led to a Response  [FrameworkBundle] Added domain column when debugging translations  [PhpUnitBridge] do not replace but require-dev in symfony/symfony  [acl][command][SecurityBundle] Fixed user input option mode to be an ArrayConflicts:composer.json
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@fabpot@xabbuh@stof

[8]ページ先頭

©2009-2025 Movatter.jp