$ php -v):=> 7.2.8 (cli)
$ php-cs-fixer -V):=> 2.13.0
=> php-cs-fixer fix test.php
return PhpCsFixer\Config::create()
->setRules([
'header_comment' => [
'header' => 'header',
],
])
;
<?php
/**
* Class A.
*/
class A
{
}
<?php
/*
* header
*/
class A
{
}
<?php
/*
* header
*/
/**
* Class A.
*/
class A
{
}
Hi @maidmaid , thanks for the report!
Sadly you've been bitten by a long standing issue about the header-rule and how the fixer should detect if a PHPDoc or comment is a header or actually belongs to the class.
Hope someone can pick this one up in the near future, till than I'll leave your report open as it is valid.
Hi @SpacePossum, thanks for your answer. At least, it's clear now.
Hmm, but a header start with /* and the class phpdoc start with /** or is a header allowed to start with /**, too?
I always thought it is fine to have a header starting with /** , however it has been removed from the PSR5 proposal https://github.com/php-fig/fig-standards/commit/03457b81d2ece8071bfa8978da9bdd3fac8612d9#diff-9a10a11696dc38209c125ea9c57a565fL62 ...