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

[FrameworkBundle] give access to non-shared services when using test.service_container #27528

Merged
merged 1 commit into from Jun 15, 2018

Conversation

Projects
None yet
3 participants
@nicolas-grekas
Member

nicolas-grekas commented Jun 6, 2018

Q A
Branch? 4.1
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #27488
License MIT
Doc PR -
@@ -32,6 +32,10 @@ public function process(ContainerBuilder $container)
foreach ($definitions as $id => $definition) {
if ($id && '.' !== $id[0] && (!$definition->isPublic() || $definition->isPrivate()) && !$definition->getErrors() && !$definition->isAbstract()) {
if (!$definition->isShared()) {
$definition->setShared(true);

This comment has been minimized.

@stof

stof Jun 6, 2018

Member

wouldn't this cause issues regarding inlining ? Rules are not the same for shared and not shared services.

This comment has been minimized.

@nicolas-grekas

nicolas-grekas Jun 6, 2018

Member

It will change the resulting inlining yes that's the goal, but inlining is only an optimization: it has no external side effect, so this is neutral, behavior wise.

@nicolas-grekas

This comment has been minimized.

Member

nicolas-grekas commented Jun 14, 2018

Implementation updated, with logic added to the inlining pass: when a non-shared service is weak-referenced, it cannot be inlined.

@nicolas-grekas

This comment has been minimized.

Member

nicolas-grekas commented Jun 14, 2018

(deps=high failure will be fixed when this is merged up to master.)

@stof

stof approved these changes Jun 14, 2018

@nicolas-grekas nicolas-grekas merged commit 516ff5a into symfony:4.1 Jun 15, 2018

2 of 3 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
fabbot.io Your code looks good.
Details

nicolas-grekas added a commit that referenced this pull request Jun 15, 2018

bug #27528 [FrameworkBundle] give access to non-shared services when …
…using test.service_container (nicolas-grekas)

This PR was merged into the 4.1 branch.

Discussion
----------

[FrameworkBundle] give access to non-shared services when using test.service_container

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

Commits
-------

516ff5a [FrameworkBundle] give access to non-shared services when using test.service_container

@nicolas-grekas nicolas-grekas deleted the nicolas-grekas:test-aliases branch Jun 15, 2018

@fabpot fabpot referenced this pull request Jun 25, 2018

Merged

Release v4.1.1 #27706

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment