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

Improve examples in parent services#3743

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

Closed
wouterj wants to merge2 commits intomasterfromdi-improve_examples

Conversation

wouterj
Copy link
Member

The code examples were not readable. That isn't a good thing for the documentation :)

QA
Doc fix?yes
New docs?no
Applies toall
Fixed tickets-

will be called twice, resulting in the ``$filters`` array containing both
``my_filter`` and ``another_filter`` objects. This is great if you just want
to add additional filters to the subclasses. If you want to replace the filters
passed to the subclass, removing the parent setting from the config will
prevent the base class from calling ``setFilter``.
prevent the base class from calling ``addFilter``.
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

this whole section seems kind of useless to me and can be simplified to a small note imo.

What this section (line 402 - 512) says is: Both methods from parentand child services are called, you can't override parent method calls. If you don't want the parent method calls, don't extend from parent.

Copy link
Member

Choose a reason for hiding this comment

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

I completely agree - let's remove it and explain that in just a few short sentences.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

made the changes :)

.. tip::

In the examples shown, the classes sharing the same configuration also extend
from the same parent in PHP. This does not need to be the case though, you can
Copy link
Member

Choose a reason for hiding this comment

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

[...] from the same parent class in PHP.

Copy link
Member

Choose a reason for hiding this comment

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

This isn't necessary at all. You can just extract common parts of similar service definitions [...]

@weaverryan
Copy link
Member

This is much much better - I agree it was kinda crazy before.@xabbuh, you had one more suggestion, which was minor, but was a slight improvement. Definitely make a PR for this :). Thanks guys!

weaverryan added a commit that referenced this pull requestApr 12, 2014
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes#3743).Discussion----------Improve examples in parent servicesThe code examples were not readable. That isn't a good thing for the documentation :)| Q   | A| --- | ---| Doc fix? | yes| New docs? | no| Applies to | all| Fixed tickets | -Commits-------0535e18 Reworded article a bita54ffed Made code readable
@weaverryanweaverryan deleted the di-improve_examples branchApril 12, 2014 14:51
xabbuh added a commit to xabbuh/symfony-docs that referenced this pull requestApr 12, 2014
@xabbuh
Copy link
Member

@weaverryan There you go:#3793

weaverryan added a commit that referenced this pull requestApr 12, 2014
This PR was merged into the 2.3 branch.Discussion----------language tweak for the tip introduced in#3743| Q             | A| ------------- | ---| Doc fix?      | yes| New docs?     | no| Applies to    | all| Fixed tickets |Commits-------deb5d71 language tweak for the tip introduced in#3743
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.

3 participants
@wouterj@weaverryan@xabbuh

[8]ページ先頭

©2009-2025 Movatter.jp