-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👍 Can you add a non-regression test please? |
2e351de
to
70a8de2
Compare
@dunglas done :) |
Or any good static code analyzer for that matter :P |
@theofidry yes of course (but it is slower) :P |
I found another bug but I don't know why it happens... Edit: Ok it happens when the extractor returns |
did you try to dump the value? |
@Ener-Getick any idea of what the isset was not working? |
@theofidry yes sorry i forgot to answer you as i updated my message... |
IIRC |
@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. |
private function assertIsString($string) | ||
{ | ||
if (!is_string($string)) { | ||
throw new \Exception(sprintf('"%s" expects strings, given "%s".', __CLASS__, gettype($string))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InvalidArgumentException?
There was a problem hiding this comment.
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 :)
`null` values aren't cached because of the use of `isset`
Should I change something else ? |
Ok for me. I'll merge it when I'll be back from vacation. |
👍 |
Thank you @Ener-Getick. |
…(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 @dunglas Commits ------- d19b151 [PropertyInfo] Fix an error in PropertyInfoCacheExtractor
An argument was forgotten in the
PropertyInfoCacheExtractor
class leading to exceptions such asand making it unusable.
ping @dunglas