QuackatronHQ / Gigarepo

Invalid property promotion PHP-W1013
Bug risk
Critical
3 occurrences in this check
Promoted properties can be in constructor only
10    }
11
12    // invalid: cannot declare promoted property outside a constructor
13    public function setName(public string $firstName, public string $lastName): void14    {
15    }
16}
Promoted property parameter $properties can not be variadic
 5class Member
 6{
 7    // invalid: Cannot declare variadic promoted property
 8    public function __construct(public ...$properties) 9    {
10    }
11}
Promoted properties are not allowed in abstract constructors
 5abstract class AbstractUser
 6{
 7    // invalid: Cannot declare promoted property in an abstract constructor
 8    abstract public function __construct(public string $firstName, public string $lastName); 9
10    abstract public function getUser(): array
11    {