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

[DI] Add check of internal type to ContainerBuilder::getReflectionClass#27025

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
stof merged 1 commit intosymfony:3.4fromupyx:fix_issue_27018
Apr 24, 2018

Conversation

@upyx
Copy link
Contributor

@upyxupyx commentedApr 24, 2018
edited by nicolas-grekas
Loading

QA
Branch?3.4
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#27018
LicenseMIT
Doc PRno

This PR fixes bug described in#27018 issue.
I think thatgetReflectionClass should returnNULL when internal type was used instead class name but not throws exception. As well as it does when class is empty. If someone have other opinion we can discuss it.

@nicolas-grekasnicolas-grekas changed the titleFix issue 27018[DI] Add check of internal type to ContainerBuilder::getReflectionClassApr 24, 2018
returnnull;
}

if ($this->isInternalType($class)) {

Choose a reason for hiding this comment

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

I'd suggest to use a private static array instead, and put types as keys in the array, so that checking could be done inline with a simple isset()

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Oh, you are right. It would be much better.

'array',
'null',
'callable',
'iterable',

Choose a reason for hiding this comment

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

I'd suggest to add "mixed" to the list: even if it's not an official one, it's pretty common in phpdoc so might be OK to use it here also

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

After some reflections I agree with you :)

@upyxupyxforce-pushed thefix_issue_27018 branch 2 times, most recently from9964403 to8c3c060CompareApril 24, 2018 08:14
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 3.4)

@stofstof changed the base branch from4.0 to3.4April 24, 2018 10:28
@stof
Copy link
Member

Thank you@upyx.

@stofstof merged commit314e881 intosymfony:3.4Apr 24, 2018
stof added a commit that referenced this pull requestApr 24, 2018
…flectionClass (upyx)This PR was submitted for the 4.0 branch but it was merged into the 3.4 branch instead (closes#27025).Discussion----------[DI] Add check of internal type to ContainerBuilder::getReflectionClass| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#27018| License       | MIT| Doc PR        | noThis PR fixes bug described in#27018 issue.I think that `getReflectionClass` should return `NULL` when internal type was used instead class name but not throws exception. As well as it does when class is empty. If someone have other opinion we can discuss it.Commits-------314e881 [DI] Add check of internal type to ContainerBuilder::getReflectionClass
@upyx
Copy link
ContributorAuthor

Thank you for your review!

@upyxupyx deleted the fix_issue_27018 branchApril 24, 2018 10:31
@chalasr
Copy link
Member

Congratz for your first contribution to Symfony@upyx :)

This was referencedApr 30, 2018
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

@stofstofstof approved these changes

@chalasrchalasrchalasr approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

5 participants

@upyx@stof@chalasr@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp