moodlehq / moodle-cs

Moodle Coding Style

Home Page:https://github.com/moodlehq/moodle-cs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to pass checks with multiline attributes using MissingDocblockSniff

ziegenberg opened this issue · comments

The following file fails with two error messages:

  • Missing docblock for class class_multiline_attribute
  • Missing docblock for function method_multiline_attribute
<?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 {
    }
}

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