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

PHP named attributes are not taken into account #1925

Open
guerinetn opened this issue Jan 24, 2024 · 7 comments
Open

PHP named attributes are not taken into account #1925

guerinetn opened this issue Jan 24, 2024 · 7 comments

Comments

@guerinetn
Copy link

guerinetn commented Jan 24, 2024

Subject Details
Plugin Php Inspections (EA Ultimate),
Language level PHP 8.2

Current behaviour

If I use a named attributes for a function it's not understood.

If I write :

$token = uniqid(more_entropy: true)

EA raise the error : Please provide 'more_entropy' parameter in order to increase likelihood of uniqueness.

It would be nice, il named attributes are understood by EA because this feature helps a lot when you have a lots of optional parameter to a function.

@COil
Copy link

COil commented Jan 31, 2024

I confirm the bug.
Capture d’écran 2024-01-31 à 08 05 15

@DannyvdSluijs
Copy link

The cause seems to be in this line of code where the arguments length is being checked as greater or equal to 4

I guess if possible the arguments should be checked for the index flags and take that argument

@kalessil
Copy link
Owner

@ea-inspections-team: +1 request to address this at least in the mentioned inspections.

@ea-inspections-team
Copy link
Collaborator

ea-inspections-team commented Feb 4, 2024

Thank you for reporting @guerinetn.

Question for everyone: are uniqid and json_decode are the only functions which we need to consider for hot-fix release?

@guerinetn
Copy link
Author

Hello @ea-inspections-team at the moment it's the only method with this issues.
Thanks for your reply

@Flexo013
Copy link

@ea-inspections-team Is there a reason this open PR #1815 has not been picked up yet to resolve this issue?

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

6 participants