Skip to content

Docblock and attributes for a class #3286

@iquito

Description

@iquito

Using PSR-12 with dev-master (with attribute support), I only encounter one issue in my projects, with a block such as:

namespace project\Controller;

use project\Auth\Authenticate;

/**
 * Shows open tasks for admins
 */
#[Authenticate('admin_logged_in')]
class TodoController extends AbstractController implements MustBeLoggedInInterface
{
}

Leads to:

 7 | [ERROR | [ ] The file-level docblock must follow the opening PHP
   |        |     tag in the file header
 9 | [ERROR | [x] Header blocks must be separated by a single blank
   |        |     line

This should cause no error, as seperating the comment and the attribute with a blank line would be incorrect (as the comment is directly for the class) and it is not a file-level docblock.

This only happens with class docblocks - method docblocks and attributes work fine together.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions