Phpinspectionsea: Disable mixing hashmap + array notation

Created on 16 Jan 2020  路  3Comments  路  Source: kalessil/phpinspectionsea

Description (screenshot):

Well, I basically wrote this bug and it took some time to find it:

2020-01-11 at 13 04

I am not sure how often people mix an indexed array with a hashmap, but maybe it could be an option to show a warning?

Example

Is this code style often used in PHP?

return [
    "key" => $value,
    $other,
    $someMore,
    "otherKey" => $otherValue,
    $end,
];

If not -> maybe show a warning if these two styles are mixed?

enhancement fixed

Most helpful comment

Implemented!

All 3 comments

Thank you for sharing @apfelbox !

Implemented!

Hi,

I didn't find this inspection on the inspection panel with this name and even though I activated almost all inspection, it doesn't seem to flag those cases.

Maybe broken?

Was this page helpful?
0 / 5 - 0 ratings