PHPCompatibility / PHPCompatibility

PHP Compatibility check for PHP_CodeSniffer

Home Page:http://techblog.wimgodden.be/tag/codesniffer/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not scanning codes properly for PHP 8.1 compatibility

AbmSourav opened this issue · comments

My custom ruleset is

...
<rule ref="PHPCompatibility" />
<config name="testVersion" value="8.1"/>

In my file.php, I have function returnIntValue($a, $b = [], $c): int { this function, which is optional parameter error in PHP 8.1.
But when I'm running ./vendor/bin/phpcs ./file.php, PHPCS is not showing any error list.
PHPCompatibility is available in "installed coding standards" list.

@AbmSourav Are you using 9.3.5 ? or develop ? 9.3.5 was released long before PHP 8.0 and we're working hard to get a new release out the door, but we're not there yet. For PHP 8.x related checks, please use the develop branch for the time being. There are other (open/closed) issues with information on how to do so.