Skip to content

Can't set config data inside ruleset.xml file #1233

New issue

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

Closed
gmponos opened this issue Dec 8, 2016 · 1 comment
Closed

Can't set config data inside ruleset.xml file #1233

gmponos opened this issue Dec 8, 2016 · 1 comment

Comments

@gmponos
Copy link
Contributor

gmponos commented Dec 8, 2016

I have upgraded to version 3 of this package and I am getting the following error:

PHP Fatal error:  Call to undefined method PHP_CodeSniffer\Ruleset::setConfigData() in /vhosts/payway.trading-point.com/symfony/vendor/squizlabs/php_codesniffer/src/Ruleset.php on line 319
PHP Stack trace:
PHP   1. {main}() /vhosts/payway.trading-point.com/symfony/vendor/squizlabs/php_codesniffer/bin/phpcs:0
PHP   2. PHP_CodeSniffer\Runner->runPHPCS() /vhosts/payway.trading-point.com/symfony/vendor/squizlabs/php_codesniffer/bin/phpcs:18
PHP   3. PHP_CodeSniffer\Runner->init() /vhosts/payway.trading-point.com/symfony/vendor/squizlabs/php_codesniffer/src/Runner.php:67
PHP   4. PHP_CodeSniffer\Ruleset->__construct() /vhosts/payway.trading-point.com/symfony/vendor/squizlabs/php_codesniffer/src/Runner.php:257
PHP   5. PHP_CodeSniffer\Ruleset->processRuleset() /vhosts/payway.trading-point.com/symfony/vendor/squizlabs/php_codesniffer/src/Rules

I have a custom ruleset.xml that I only use the core sniffs. Once I remove the following two following lines from my ruleset everything seems to work fine

    <config name="show_progress" value="1" />
    <config name="ignore_warnings_on_exit" value="1" />

But according to the wiki:

Note: If you only use the built-in coding standards, or you have a custom ruleset.xml file that only makes use of the sniffs and reports distributed with PHP_CodeSniffer, you do not need to make any changes to begin using PHP_CodeSniffer version 3.

I guess this is a bug because I can't find a function setConfigData in the file for this line.

@gsherwood gsherwood changed the title Call to undefined method PHP_CodeSniffer\Ruleset::setConfigData() Can't set config data inside ruleset.xml file Dec 12, 2016
@gsherwood
Copy link
Member

This has been fixed now. Thanks a lot for reporting it, and especially for testing 3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants