Skip to content
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

False-positive : "[EA] Could provoke a PHP Fatal error ([] operator not supported for strings)" in test #1915

Open
uncaught opened this issue Nov 9, 2023 · 0 comments

Comments

@uncaught
Copy link

uncaught commented Nov 9, 2023

Subject Details
Plugin Php Inspections (EA Extended) 5.0.0.0
Language level PHP 8.2

Current behaviour

When assigning a string to a static array in a test class, EA reports this as a fatal error, but only if this was done in the setUpBeforeClass method of phpunit. This is quite weird, but see:

image

The error is "[EA] Could provoke a PHP Fatal error ([] operator not supported for strings)".

If I rename setUpBeforeClass to something else or comment it out completely, the assignment is not reported as fatal:

image

Expected behaviour

The property type is defined as array and EA should not assume this to be a string for some reason.

Environment details

PhpStorm 2023.2.3 on Windows 10
Code in WSL (Ubuntu 20)

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

No branches or pull requests

1 participant