We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi!
I updated the companies ruleset to check the code against PHP 7.0 code and up, with
<!-- Check code for cross-version PHP compatibility. --> <config name="testVersion" value="7.0-"/> <rule ref="PHPCompatibilityWP"/>
So in my project's phpcs.xml.dist I added
phpcs.xml.dist
<?xml version="1.0"?> <ruleset name="My Project"> <rule ref="Infinum" /> <config name="testVersion" value="7.2-"/> <rule ref="PHPCompatibilityWP"/> </ruleset>
because I'm actually working on PHP 7.2, and I'm using things like typehinting a void return value of a method.
void
The problem is that the config set in my project's ruleset is not overwritten and I'm getting errors like
error - void return type is not present in PHP version 7.0 or earlier (PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound)
Am I doing something wrong? This should be like any other rule for PHPCS.
The text was updated successfully, but these errors were encountered:
This is a known issue in PHPCS - see: squizlabs/PHP_CodeSniffer#1821 and squizlabs/PHP_CodeSniffer#2197
Since PHPCS 3.3.0, you can, at least, overrule the testVersion set in a ruleset by using the command line, which for now is the only solution (or use the hack described in 2197 above). See: https://github.com/PHPCompatibility/PHPCompatibility#testversion-in-the-ruleset-versus-command-line
testVersion
Sorry, something went wrong.
Oh, that's a shame. I'll wait for the fix then, thanks!
No branches or pull requests
Hi!
I updated the companies ruleset to check the code against PHP 7.0 code and up, with
So in my project's
phpcs.xml.dist
I addedbecause I'm actually working on PHP 7.2, and I'm using things like typehinting a
void
return value of a method.The problem is that the config set in my project's ruleset is not overwritten and I'm getting errors like
Am I doing something wrong? This should be like any other rule for PHPCS.
The text was updated successfully, but these errors were encountered: