You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package depends on version "^9.3" of the phpcompatibility/php-compatibility dependency.
This includes the latest stable version 9.3.5, which is now more than 3 years old. As a result, PHP 8 is not fully supported. This introduces lots of missed cases, but can also introduces false positives.
For example, consider this backed enum code:
<?phpenum Foo: string
{
case Bar = 'bar';
publicfunctiongetValue(): string
{
return$this->value;
}
}
This generates an error regarding the use of $this:
$ vendor/bin/phpcs --standard=PHPCompatibility --runtime-set testVersion 8.1 file.php
FILE: /path/to/file.php
-----------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------
9 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
-----------------------------------------------------------------------------------------------------
A temporary workaround is to make use of the latest dev-develop version of this dependency, which has muchbettersupport for PHP 8.
To include this in a project that uses the ISAAC PHP_CodeSniffer Standard, you can upgrade the dependency
$ composer require --dev --with-all-dependencies "phpcompatibility/php-compatibility:dev-develop as 9.3.5"
This package depends on version "^9.3" of the phpcompatibility/php-compatibility dependency.
This includes the latest stable version 9.3.5, which is now more than 3 years old. As a result, PHP 8 is not fully supported. This introduces lots of missed cases, but can also introduces false positives.
For example, consider this backed enum code:
This generates an error regarding the use of $this:
A temporary workaround is to make use of the latest dev-develop version of this dependency, which has much better support for PHP 8.
To include this in a project that uses the ISAAC PHP_CodeSniffer Standard, you can upgrade the dependency
However, I am hesitant to create a PR to update phpcompatibility/php-compatibility to dev-develop, as the development version currently contains false positives and false negatives.
The text was updated successfully, but these errors were encountered: