- Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Closed
Copy link
Description
Describe the bug
PHPCS fails when using PHP 8 Constructor property promotion with attributes.
FILE: /app/src/Entity/LogLoginFailure.php --------------------------------------------------------------------------------------------------------- FOUND 4 ERRORS AFFECTING 4 LINES --------------------------------------------------------------------------------------------------------- 75 | ERROR | [x] Multi-line function declaration not indented correctly; expected 8 spaces but found 12 76 | ERROR | [x] Multi-line function declaration not indented correctly; expected 8 spaces but found 12 79 | ERROR | [x] Multi-line function declaration not indented correctly; expected 8 spaces but found 12 80 | ERROR | [x] Multi-line function declaration not indented correctly; expected 8 spaces but found 12 ---------------------------------------------------------------------------------------------------------
Code sample
public function __construct( #[ORM\ManyToOne( targetEntity: User::class, // <-- line 75 inversedBy: 'logsLoginFailure', // <-- line 76 )] #[ORM\JoinColumn( name: 'user_id', // <-- line 79 nullable: false, // <-- line 80 )] #[Groups([ 'LogLoginFailure', 'LogLoginFailure.user', ])] private User $user ) { $this->id = $this->createUuid(); $this->timestamp = new DateTimeImmutable(timezone: new DateTimeZone('UTC')); }
Expected behavior
No errors
Versions (please complete the following information):
- PHP: 8.0.10
- PHPCS: 3.6.0
- Standard: PSR2, PSR12