Skip to content

Fixed incompatibility between ServiceSubscriberTrait and classes with protected $container property #33521

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

Merged
merged 1 commit into from
Sep 11, 2019

Conversation

a-menshchikov
Copy link
Contributor

Q A
Branch? 4.3
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #33355
License MIT
Doc PR

@@ -22,7 +22,7 @@
trait ServiceSubscriberTrait
{
/** @var ContainerInterface */
private $container;
private $serviceContainer;
Copy link
Member

@nicolas-grekas nicolas-grekas Sep 10, 2019

Choose a reason for hiding this comment

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

Hum, looking at the code again, the property is the only way to access the container. Which means this change would break anyone using it 100% guaranteed.
That's no-go from BC perspective.
Making the property protected might be the way to go.

@a-menshchikov a-menshchikov changed the title Fixed incompatibility between ServiceSubscriberTrait and classes with public/protected $container property Fixed incompatibility between ServiceSubscriberTrait and classes with protected $container property Sep 10, 2019
@fabpot
Copy link
Member

fabpot commented Sep 11, 2019

Thank you @a-menshchikov.

fabpot added a commit that referenced this pull request Sep 11, 2019
…lasses with protected $container property (a-menshchikov)

This PR was squashed before being merged into the 4.3 branch (closes #33521).

Discussion
----------

Fixed incompatibility between ServiceSubscriberTrait and classes with protected $container property

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #33355
| License       | MIT
| Doc PR        |

Commits
-------

954dad4 Fixed incompatibility between ServiceSubscriberTrait and classes with protected $container property
@fabpot fabpot merged commit 954dad4 into symfony:4.3 Sep 11, 2019
@a-menshchikov a-menshchikov deleted the issue_33355 branch September 15, 2019 07:20
@fabpot fabpot mentioned this pull request Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants