Skip to content

[PropertyInfo] PropertyInfoCacheExtractor emits a warning #31929

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

Closed
bastnic opened this issue Jun 7, 2019 · 3 comments
Closed

[PropertyInfo] PropertyInfoCacheExtractor emits a warning #31929

bastnic opened this issue Jun 7, 2019 · 3 comments

Comments

@bastnic
Copy link
Contributor

bastnic commented Jun 7, 2019

Symfony version(s) affected: 4.3.1

Description
Since upgrade from 4.2.9 to 4.3.1, a Warning is sent on PropertyInfoCacheExtractor::extract

Warning : array_key_exists() expects parameter 2 to be array, null given => /var/www/project/apps/api/vendor/symfony/property-info/PropertyInfoCacheExtractor.php::124

How to reproduce
Not clear yet, I didn't narrow what the problem is yet, I don't have the problem on other project that use almost the same stack.

In test mode, it crashes because of sensibility, it works on prod mode.

Since this PR I presume #30525.

Possible Solution
On ligne 114, there is a first check:

if (\array_key_exists($encodedMethod, $this->arrayCache) && \array_key_exists($serializedArguments, $this->arrayCache[$encodedMethod])) {

On ligne 124, there is not:

if (\array_key_exists($serializedArguments, $data[$encodedMethod])) {

So we should add a check \array_key_exists($encodedMethod, $data). And maybe trace back what to do with it, as I have a lot of empty cache set because of that.

@bastnic
Copy link
Contributor Author

bastnic commented Jun 7, 2019

Update: see #30525.

@lyrixx lyrixx changed the title Warning on PropertyInfo [PropertyInfo] Warning on PropertyInfo Jun 7, 2019
@lyrixx lyrixx changed the title [PropertyInfo] Warning on PropertyInfo [PropertyInfo] PropertyInfoCacheExtractor emits a warning Jun 7, 2019
@bastnic
Copy link
Contributor Author

bastnic commented Jun 26, 2019

The corresponding PR has just been revert (see #32165), so not a subject anymore

@bastnic bastnic closed this as completed Jun 26, 2019
@xabbuh
Copy link
Member

xabbuh commented Jun 26, 2019

If you manage to track down what exactly causes the issue, we should probably still add a test case covering this to prevent breaking it again in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants