I've recently tried introducing Duster into a new Laravel project and noticed that I am unable to use any typed class constants as introduced with PHP 8.3. As an example, the following code currently fails linting:
class Test {
protected const string ABC = 'Hello World';
}
The reported error is caused by the Generic.NamingConventions.UpperCaseConstantName sniff, which reports Class constants must be uppercase; expected STRING but found string, therefor indicating that the type is checked instead of the actual name of the constant.
Some quick research on my side about PHP_CodeSniffer has shown that their latest release 3.9.0 added support for typed class constants, including an update for the affected sniff. Linting the same code snippet with PHPCS 3.9.0 directly outside of Duster also no longer reports any issues.
Would it be possible to bump this dependency and ship a new Duster release, so that PHP 8.3 is better supported? Thanks a lot in advance, Duster ships some really nice and sane defaults!
I've recently tried introducing Duster into a new Laravel project and noticed that I am unable to use any typed class constants as introduced with PHP 8.3. As an example, the following code currently fails linting:
The reported error is caused by the
Generic.NamingConventions.UpperCaseConstantName
sniff, which reportsClass constants must be uppercase; expected STRING but found string
, therefor indicating that the type is checked instead of the actual name of the constant.Some quick research on my side about PHP_CodeSniffer has shown that their latest release 3.9.0 added support for typed class constants, including an update for the affected sniff. Linting the same code snippet with PHPCS 3.9.0 directly outside of Duster also no longer reports any issues.
Would it be possible to bump this dependency and ship a new Duster release, so that PHP 8.3 is better supported? Thanks a lot in advance, Duster ships some really nice and sane defaults!