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

[PropertyInfo] Fix an error in PropertyInfoCacheExtractor#19437

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
GuilhemN wants to merge2 commits intosymfony:3.1fromGuilhemN:patch-3

Conversation

@GuilhemN
Copy link
Contributor

@GuilhemNGuilhemN commentedJul 26, 2016
edited
Loading

QA
Branch?3.1
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PR

An argument was forgotten in thePropertyInfoCacheExtractor class leading to exceptions such as

PHP Warning:  ucfirst() expects parameter 1 to be string, array given in /home/guilhem/github/ast-test/vendor/symfony/symfony/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php on line 318

and making it unusable.

ping@dunglas

@dunglas
Copy link
Member

👍

Can you add a non-regression test please?

@GuilhemNGuilhemNforce-pushed thepatch-3 branch 4 times, most recently from2e351de to70a8de2CompareJuly 26, 2016 17:35
@GuilhemN
Copy link
ContributorAuthor

@dunglas done :)
BTW this shows how much php7 type hints are useful ! I hope symfony 4 will remove php5 support.

theofidry reacted with laugh emoji

@theofidry
Copy link
Contributor

BTW this shows how much php7 type hints are useful !

Or any good static code analyzer for that matter :P

@GuilhemN
Copy link
ContributorAuthor

@theofidry yes of course (but it is slower) :P

theofidry reacted with laugh emoji

@GuilhemN
Copy link
ContributorAuthor

GuilhemN commentedJul 27, 2016
edited
Loading

I found another bug but I don't know why it happens...
This condition is nevertrue and the psr cache is always used.
Usingarray_key_exists solves this issue. Any idea ?

Edit: Ok it happens when the extractor returnsnull. I'll submit a commit.

@theofidry
Copy link
Contributor

did you try to dump the value?

@theofidry
Copy link
Contributor

@Ener-Getick any idea of what the isset was not working?

@GuilhemN
Copy link
ContributorAuthor

@theofidry yes sorry i forgot to answer you as i updated my message...
Isset is kind of equals tonull !== @$value so when the value cached isnull,isset returnsfalse whereasarray_key_exists which returns true as long as the value exists.

@theofidry
Copy link
Contributor

IIRCnull is not cached in most cache systems, shouldn't we avoid to cache it here as well?

@GuilhemN
Copy link
ContributorAuthor

GuilhemN commentedJul 27, 2016
edited
Loading

@theofidry it is cached in the cross requests cache but it is not fetched in the array cache which is only here because it is faster than the first one. So it will be cached anyway the only thing changing are the performances.

privatefunctionassertIsString($string)
{
if (!is_string($string)) {
thrownew \Exception(sprintf('"%s" expects strings, given "%s".',__CLASS__,gettype($string)));

Choose a reason for hiding this comment

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

InvalidArgumentException?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

It doesn't matter that much as it's a fixture but it's indeed more adapted here.
updated :)

@GuilhemN
Copy link
ContributorAuthor

Should I change something else ?

@dunglas
Copy link
Member

Ok for me. I'll merge it when I'll be back from vacation.

GuilhemN reacted with hooray emoji

@nicolas-grekas
Copy link
Member

👍
Status: reviewed

@fabpot
Copy link
Member

Thank you @Ener-Getick.

fabpot added a commit that referenced this pull requestAug 15, 2016
…(Ener-Getick)This PR was squashed before being merged into the 3.1 branch (closes#19437).Discussion----------[PropertyInfo] Fix an error in PropertyInfoCacheExtractor| Q             | A| ------------- | ---| Branch?       | 3.1| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |An argument was forgotten in the ``PropertyInfoCacheExtractor`` class leading to exceptions such as```PHP Warning:  ucfirst() expects parameter 1 to be string, array given in /home/guilhem/github/ast-test/vendor/symfony/symfony/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php on line 318```and making it unusable.ping@dunglasCommits-------d19b151 [PropertyInfo] Fix an error in PropertyInfoCacheExtractor
@fabpotfabpot closed thisAug 15, 2016
@GuilhemNGuilhemN deleted the patch-3 branchAugust 22, 2016 12:54
@fabpotfabpot mentioned this pull requestSep 3, 2016
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

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@GuilhemN@dunglas@theofidry@nicolas-grekas@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp