CodeSniffer with PHPStorm produces errors -
i'm working on wordpress project using phpstorm. beautify code downloaded next codesniffer rules wp , set them in build directory in project folder: https://github.com/mrchrisadams/wordpress-coding-standards
now when set phpstorm utilize ruleset.xml, next error:
php code sniffer phpcs: php fatal error: cannot redeclare class wordpress_sniffs_strings_doublequoteusagesniff in /var/www/projectname/build/codesniffer/sniffs/strings/doublequoteusagesniff.php on line 31 php stack trace: php 1. {main}() /usr/bin/phpcs:0 php 2. php_codesniffer_cli->process() /usr/bin/phpcs:37 php 3. php_codesniffer->process() /usr/share/php/php/codesniffer/cli.php:561 php 4. php_codesniffer->populatetokenlisteners() /usr/share/phpphp/codesniffer.php:458 php 5. php_codesniffer::autoload() /usr/share/php/php/codesniffer.php:0 i work on project (not @ same time) based on drupal having own ruleset.xml - works without problems.
does know kind of issue?
this error not related phpstorm , beingness generated php_codesniffer itself.
it appears when sniff classes not named. must strictly follow directory construction , file of sniff.
if class called wordpress_sniffs_strings_doublequoteusagesniff
it should located in: /standards/wordpress/sniffs/strings/doublequoteusagesniff.php
phpstorm codesniffer
No comments:
Post a Comment