- Issue created by @wengerk
- Status changed to Fixed
9 months ago 1:30pm 16 February 2024 Automatically closed - issue fixed for 2 weeks with no activity.
When having a class with PHP Attributes attached to properties we get the following phpcs error
Missing member variable doc comment
...
/**
* Bar property.
*
* @var bool
*/
#[NotBlank]
private bool $bar;
...
run phpcs against
<?php
use Symfony\Component\Validator\Constraints\NotBlank;
/**
* Foo class description.
*/
class Foo {
/**
* Bar property.
*
* @var bool
*/
#[NotBlank]
private bool $bar;
}
A working workaround for now is to add the attribute before the comment, but it's not a very common practice on the Symfony landscape.
<?php
use Symfony\Component\Validator\Constraints\NotBlank;
/**
* Foo class description.
*/
class Foo {
#[NotBlank]
/**
* Bar property.
*
* @var bool
*/
private bool $bar;
}
Automatically closed - issue fixed for 2 weeks with no activity.