Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve examples in parent services #3743

Closed
wants to merge 2 commits into from
Closed

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Mar 31, 2014

The 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 -

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
Member Author

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 parent and 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
Member Author

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 request Apr 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 services

The 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 bit
a54ffed Made code readable
@weaverryan weaverryan closed this Apr 12, 2014
@weaverryan weaverryan deleted the di-improve_examples branch April 12, 2014 14:51
xabbuh added a commit to xabbuh/symfony-docs that referenced this pull request Apr 12, 2014
@xabbuh
Copy link
Member

xabbuh commented Apr 12, 2014

@weaverryan There you go: #3793

weaverryan added a commit that referenced this pull request Apr 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 free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants