-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Describe the bug
Promoted properties without PHPDoc was fixed in 3.6.0, but with PHPDoc it still gives an error (in 3.6.0):
Multi-line function declaration not indented correctly; expected 8 spaces but found 0
Code sample
use Symfony\Component\Validator\Constraints as Assert;
final class Command
{
public function __construct(
/**
* @var string
* @Assert\NotBlank()
*/
public string $username
)
{
}
}
Custom ruleset
<?xml version="1.0" encoding="UTF-8"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<arg name="basepath" value="."/>
<arg name="cache" value=".phpcs-cache"/>
<arg name="colors"/>
<arg name="extensions" value="php"/>
<rule ref="PSR12"/>
<file>src/</file>
</ruleset>
To reproduce
You can try to build this project:
https://github.com/Arslanoov/messenger-api
- git clone https://github.com/Arslanoov/messenger-api.git
- make init
- make install-deps
- make cs
Or create a class with promoted properties and PHPDoc
ERROR | [x] Multi-line function declaration not indented correctly; expected 8 spaces but found 0
Expected behavior
No error on promoted properties with PHPDoc
Versions (please complete the following information):
- OS: Ubuntu 20.04
- PHP: 8.0
- PHPCS: 3.6.0
- Standard: PSR12