Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to pass checks with multiline attributes using MissingDocblockSniff #130

Closed
ziegenberg opened this issue Mar 22, 2024 · 1 comment · Fixed by #132
Closed

Unable to pass checks with multiline attributes using MissingDocblockSniff #130

ziegenberg opened this issue Mar 22, 2024 · 1 comment · Fixed by #132

Comments

@ziegenberg
Copy link
Contributor

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 {
    }
}
@ziegenberg
Copy link
Contributor Author

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

@stronk7 stronk7 linked a pull request Mar 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant