Skip to content

PSR12.Files.FileHeader detects @var annotations as file docblocks #2626

@omsi668

Description

@omsi668

PHPCS Version : 3.5.0
PHP Version : 7.2.19

Hello,

On my project, I've got a lot of view files with no File Header but with a first DocBlock declaring vars to avoid bad inspection and use autocomplete.

These files raise an error with the new standard :
5 | ERROR | The file-level docblock must follow the opening PHP tag in the file header
| | (PSR12.Files.FileHeader.IncorrectOrder)

Here is the start of my file :

<?php

use common\models\JobFunction;

/** @var JobFunction $model */

As you can see, this is not a file level docblock and therefore it should not raise this error.

Thank you, have a good day

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions