moodlehq / moodle-cs

Moodle Coding Style
https://github.com/moodlehq/moodle-cs
GNU General Public License v3.0
18 stars 16 forks source link

Incorrect fix for multi-line array #178

Open andrewnicols opened 4 months ago

andrewnicols commented 4 months ago
        $fields['maildigest'] = ['type' => PARAM_INT, 'null' => NULL_NOT_ALLOWED,
                'default' => $CFG->defaultpreference_maildigest, ];

Should be:

        $fields['maildigest'] = [
            'type' => PARAM_INT,
            'null' => NULL_NOT_ALLOWED,
            'default' => $CFG->defaultpreference_maildigest,
        ];
stronk7 commented 4 months ago

Is that the NormalizedArrays.Arrays.CommaAfterLastsniff?

If so, yeah, that one is imperfect, recently we were able to get accepted some new error codes, in order to allow missing trailing commas when the closer (]) is in the same line (we allow that), but I imagine that, maybe, the fixer does not consider that. Tricky one as far as it's not ours...