Skip to content

[DependencyInjection] Fix container injection with TypedReference #39873

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
Jan 18, 2021

Conversation

jderusse
Copy link
Member

Q A
Branch? 5.1
Bug fix? yes
New feature? no
Deprecations? no
Tickets fix #
License MIT
Doc PR -

When using TypedReference, the closure signature is function (...): Type { which does not matche the regular expresion that replace $this by $container + use ($container)

note: there is no issue in 4.4. At that time, dumped container use $this->services and looks like:

$instance->closures = [0 => function (): ?\stdClass {\n
    return ($this->services['foo'] ?? null);\n
}];

@carsonbot carsonbot added this to the 5.1 milestone Jan 18, 2021
@nicolas-grekas nicolas-grekas changed the title Fix container injection with TypedReference [DI] Fix container injection with TypedReference Jan 18, 2021
@jderusse jderusse force-pushed the di-fix-service-closure branch from 2e6a1ab to f8c14ac Compare January 18, 2021 13:54
@carsonbot carsonbot changed the title [DI] Fix container injection with TypedReference [DependencyInjection] Fix container injection with TypedReference Jan 18, 2021
@nicolas-grekas
Copy link
Member

Thank you @jderusse.

@nicolas-grekas nicolas-grekas merged commit b4ec36f into symfony:5.1 Jan 18, 2021
@jderusse jderusse deleted the di-fix-service-closure branch January 25, 2021 09:16
This was referenced Jan 27, 2021
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.

3 participants