slevomat / coding-standard

Slevomat Coding Standard for PHP_CodeSniffer provides many useful sniffs
MIT License
1.37k stars 170 forks source link

DeclareStrictTypes to comply with PSR12.Files.FileHeader.IncorrectOrder #1685

Open Morgy93 opened 1 month ago

Morgy93 commented 1 month ago

Hello,

is it possible for SlevomatCodingStandard.TypeHints.DeclareStrictTypes to set the declare() below the file docblock to comply with PSR12.Files.FileHeader.IncorrectOrder?

So, instead of:

<?php

declare(strict_types=1);

/**
 * This file contains an example of coding styles.
 */

It needs to be:

<?php

/**
 * This file contains an example of coding styles.
 */

declare(strict_types=1);

Otherwise, it throws The file-level docblock must follow the opening PHP tag in the file header (PSR12.Files.FileHeader.IncorrectOrder).

Any idea?