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] Add iterable to possible binding type#44979

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

Merged
nicolas-grekas merged 1 commit intosymfony:4.4fromsveneld:fix_ResolveBindingsPass
Jan 12, 2022
Merged

[DependencyInjection] Add iterable to possible binding type#44979

nicolas-grekas merged 1 commit intosymfony:4.4fromsveneld:fix_ResolveBindingsPass
Jan 12, 2022

Conversation

@sveneld
Copy link
Contributor

@sveneldsveneld commentedJan 11, 2022
edited by nicolas-grekas
Loading

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
LicenseMIT

When iterable type is set in binding like in examplehttps://symfony.com/doc/current/service_container.html#binding-arguments-by-name-or-type, system tries to autoload class iterable here src/Symfony/Component/DependencyInjection/Compiler/ResolveBindingsPass.php:137

if (is_subclass_of($m[1], \UnitEnum::class)) {

@nicolas-grekas
Copy link
Member

Please add a test case that covers the situation.

@sveneld
Copy link
ContributorAuthor

Add test for this case

@sveneld
Copy link
ContributorAuthor

@nicolas-grekas done


publicfunctiontestIterableBindingTypehint()
{
spl_autoload_register(

Choose a reason for hiding this comment

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

is this required? if not let's remove it

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

it's required to show the problem, if this function will run it will mean that code of ResolveBindingsPass.php working incorrect

$pass =newResolveBindingsPass();
$pass->process($container);

$this->assertInstanceOf(

Choose a reason for hiding this comment

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

on one line please

);

$container =newContainerBuilder();
$bindings = [

Choose a reason for hiding this comment

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

the variable could be removed

@nicolas-grekasnicolas-grekas modified the milestones:5.4,4.4Jan 12, 2022
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

(for 4.4)

@nicolas-grekas
Copy link
Member

Thank you@sveneld.

sveneld reacted with hooray emoji

@nicolas-grekasnicolas-grekas merged commit9f89250 intosymfony:4.4Jan 12, 2022
@sveneldsveneld deleted the fix_ResolveBindingsPass branchJanuary 12, 2022 13:18
This was referencedJan 28, 2022
This was referencedJan 28, 2022
nicolas-grekas added a commit that referenced this pull requestFeb 16, 2022
This PR was submitted for the 5.4 branch but it was merged into the 4.4 branch instead.Discussion----------[DependencyInjection] Fix type binding| Q             | A| ------------- | ---| Branch?       | 5.4| Bug fix?      | yes| License       | MITIf $type is a scalar compiler pass should not check it in function is_subclass_of($type, \UnitEnum::class), because is_subclass_of trying to autoload class with name array, string, etc.Related to#44979Commits-------3754018 Fix type binding
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@chalasrchalasrAwaiting requested review from chalasr

@dunglasdunglasAwaiting requested review from dunglas

@lyrixxlyrixxAwaiting requested review from lyrixx

@wouterjwouterjAwaiting requested review from wouterj

@xabbuhxabbuhAwaiting requested review from xabbuh

@ycerutoycerutoAwaiting requested review from yceruto

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

3 participants

@sveneld@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp