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] Add a new Syntax to define factories as callables#12008

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 2 commits intosymfony:masterfromfabpot:dic-factory
Sep 24, 2014

Conversation

@fabpot
Copy link
Member

QA
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?yes
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

From the original PR#9839:

"This pull requests adds a new syntax to define factories based on the syntax for configurators. This is more flexible than the old syntax (factoryMethod and either of factoryClass or factoryService), as it also allows for functions as factories.

Since the service is now a Reference to a Definition it also allows us to inline factories for a small performance improvement and better encapsulation.

Lastly this prevents a bug where a private factory is simple removed because it's not referenced in the graph.

I did not change any of the existing definitions (there's one use of a factory in FrameworkBundle) or automatically use the new internal representation when parsing YAML or XML definitions because this could introduce subtle B/C issues.
"

Copy link
Contributor

Choose a reason for hiding this comment

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

Typo.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

good catch!

@stof
Copy link
Member

👍

1 similar comment
@fabpot
Copy link
MemberAuthor

👍

@fabpotfabpot merged commit187aeee intosymfony:masterSep 24, 2014
fabpot added a commit that referenced this pull requestSep 24, 2014
…ries as callables (realityking, fabpot)This PR was merged into the 2.6-dev branch.Discussion----------[DependencyInjection] Add a new Syntax to define factories as callables| Q             | A| ------------- | ---| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | yes| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -From the original PR#9839:"This pull requests adds a new syntax to define factories based on the syntax for configurators. This is more flexible than the old syntax (factoryMethod and either of factoryClass or factoryService), as it also allows for functions as factories.Since the service is now a Reference to a Definition it also allows us to inline factories for a small performance improvement and better encapsulation.Lastly this prevents a bug where a private factory is simple removed because it's not referenced in the graph.I did not change any of the existing definitions (there's one use of a factory in FrameworkBundle) or automatically use the new internal representation when parsing YAML or XML definitions because this could introduce subtle B/C issues."Commits-------187aeee fixed CSbd8531d added a new Syntax to define factories as callables.
@fabpotfabpot deleted the dic-factory branchSeptember 26, 2014 06:45
fabpot added a commit that referenced this pull requestOct 3, 2014
This PR was merged into the 2.6-dev branch.Discussion----------[DependencyInjection] Tweaked factories| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#12008| License       | MIT| Doc PR        | n/aThere are some issues with new service factories: * `ContainerBuilder` cannot instantiate service from factory (i.e. currently it works for dumped code only) * Dumped code sometimes is invalid (anonymous services as factories, factories without arguments)Commits-------ee82392 [DependencyInjection] Tweaked factories
weaverryan added a commit to symfony/symfony-docs that referenced this pull requestNov 24, 2014
This PR was merged into the 2.6 branch.Discussion----------Use new factory syntax| Q   | A| --- | ---| Doc fix? | no| New docs? | yes (symfony/symfony#12008)| Applies to | 2.6+| Fixed tickets |#4291Commits-------9cbcc2b Applied fixesd7998b0 Use new factory syntax
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@fabpot@stof@unkind@realityking

[8]ページ先頭

©2009-2025 Movatter.jp