kalessil / phpinspectionsea

A Static Code Analyzer for PHP (a PhpStorm/Idea Plugin)
https://plugins.jetbrains.com/plugin/7622?pr=phpStorm
Other
1.45k stars 118 forks source link

PHP named attributes are not taken into account #1925

Open guerinetn opened 10 months ago

guerinetn commented 10 months ago
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 commented 9 months ago

I confirm the bug.

Capture d’écran 2024-01-31 à 08 05 15
DannyvdSluijs commented 9 months ago

Other methods have the same issues e.g. json_decode

Screenshot 2024-01-31 at 08 51 24

And it seems to be a duplicate of:

DannyvdSluijs commented 9 months ago

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 commented 9 months ago

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

ea-inspections-team commented 9 months ago

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 commented 8 months ago

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

Flexo013 commented 6 months ago

@ea-inspections-team Is there a reason this open PR https://github.com/kalessil/phpinspectionsea/pull/1815 has not been picked up yet to resolve this issue?

Elnadrion commented 5 months ago

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

+1

DannyvdSluijs commented 5 months ago

@kalessil I wanted to kindly check with you if this is something @ea-inspections-team is working on?

Perhaps some pointers could be given in order help me (or other people watching this issue) out in trying to create a PR addressing this issue?

ea-inspections-team commented 1 month ago

Thank you for your patience, everyone. We are working on fixes for the functions and inspections mentioned in this issue and will release Extended and Ultimate plugins after the fixes.

ea-inspections-team commented 1 month ago

We are still working on fixes for the issue and delaying the next releases for around week - v2024.2 for EA ultimate and v 5.1.0 for EA Extended. If no solution found today, we will proceed with the releases tomorrow.