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

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

Closed
omsi668 opened this issue Oct 1, 2019 · 1 comment
Closed

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

omsi668 opened this issue Oct 1, 2019 · 1 comment

Comments

@omsi668
Copy link

omsi668 commented Oct 1, 2019

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

@gsherwood gsherwood added this to Idea Bank in PHPCS v3 Development via automation Oct 1, 2019
@gsherwood gsherwood added this to the 3.5.1 milestone Oct 1, 2019
@gsherwood gsherwood moved this from Idea Bank to Backlog in PHPCS v3 Development Oct 1, 2019
@gsherwood gsherwood changed the title PSR12.Files.FileHeader.IncorrectOrder detects every first block PSR12.Files.FileHeader detects @var annotations as file docblocks Oct 3, 2019
gsherwood added a commit that referenced this issue Oct 3, 2019
@gsherwood
Copy link
Member

Thanks for the report. I've fixed this issue in master and it will be released in 3.5.1

PHPCS v3 Development automation moved this from Backlog to Ready for Release Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
PHPCS v3 Development
Ready for Release
Development

No branches or pull requests

2 participants