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: added missing use $container#37665

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
ghost wants to merge1 commit intosymfony:masterfromunknown repository
Closed

DependencyInjection: added missing use $container#37665

ghost wants to merge1 commit intosymfony:masterfromunknown repository

Conversation

@ghost
Copy link

@ghostghost commentedJul 25, 2020
edited by nicolas-grekas
Loading

QA
Branch?5.1
Bug fix?yes
New feature?no
Deprecations?no

If you use not shared services, $container was not shared in closure. Error-Message: Notice: Undefined variable: $container

@nicolas-grekas
Copy link
Member

As highlighted in the failing test case, there are situations where theuse should not be dumped.
Can you please provide a test case that fails? If not, can you provide a reproducer instead?

@nicolas-grekasnicolas-grekas added this to the5.1 milestoneJul 29, 2020
@ghost
Copy link
Author

Hi Nicolas,

Of course. Here you can will find an example project.

https://github.com/DarkyMuc/symfony_di_example
composer install
symfony server:start -port 8001

After you call this project via browser, you receive the error "Notice: Undefined variable: container"

I think it's the combination of shared: false and lazy: true in the service.yaml.

Greetings Markus

@nicolas-grekas
Copy link
Member

Thanks for all the details, fixed in#37953

fabpot added a commit that referenced this pull requestAug 26, 2020
This PR was merged into the 5.1 branch.Discussion----------[DI] fix dumping lazy non-shared services| Q             | A| ------------- | ---| Branch?       | 5.1| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       |Fix#37665| License       | MIT| Doc PR        | -Commits-------a4f4ca7 [DI] fix dumping lazy non-shared services
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

5.1

Development

Successfully merging this pull request may close these issues.

4 participants

@nicolas-grekas@xabbuh@carsonbot@MarkusFoitzikC24

[8]ページ先頭

©2009-2025 Movatter.jp