moodlehq / moodle-cs

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

Unable to pass checks with multiline attributes using MissingDocblockSniff #130

Closed ziegenberg closed 8 months ago

ziegenberg commented 8 months ago

The following file fails with two error messages:

<?php

namespace MoodleHQ\MoodleCS\moodle\Tests\Sniffs\PHPUnit;

defined('MOODLE_INTERNAL') || die(); // Make this always the 1st line in all CS fixtures.

/**
 * Example class. 
 */
#[\Attribute(
    attr1: 'asdf',
    attr2: 'asdf',
)]
class class_multiline_attribute {

    /**
     * Method attribute.
     */
    #[\Attribute(
        attr1: 'asdf',
        attr2: 'asdf',
    )]
    function method_multiline_attribute(): void {
    }
}
ziegenberg commented 8 months ago

I added two test cases for this in PR #131. You may extend them with the fix.