Skip to content
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

CodeSniffer.conf not working with 3.x PHAR file #1241

Closed
guenti opened this issue Dec 14, 2016 · 2 comments
Closed

CodeSniffer.conf not working with 3.x PHAR file #1241

guenti opened this issue Dec 14, 2016 · 2 comments

Comments

@guenti
Copy link

guenti commented Dec 14, 2016

I've installed the version 3.0.0rc2 and won't play with it, but I can not set config options. If I fire up a command following fatal error will return:

phpcs --config-set show_progress 1
PHP Fatal error: Uncaught PHP_CodeSniffer\Exceptions\RuntimeException: Config file phar:///usr/local/bin/phpcs/src/../CodeSniffer.conf is not writable in phar:///usr/local/bin/phpcs/src/Config.php:2
Stack trace:
#0 phar:///usr/local/bin/phpcs/src/Config.php(2): PHP_CodeSniffer\Config::setConfigData('show_progress', '1')
#1 phar:///usr/local/bin/phpcs/src/Config.php(2): PHP_CodeSniffer\Config->processLongArgument('config-set', 0)
#2 phar:///usr/local/bin/phpcs/src/Config.php(2): PHP_CodeSniffer\Config->setCommandLineValues(Array)
#3 phar:///usr/local/bin/phpcs/src/Runner.php(2): PHP_CodeSniffer\Config->__construct()
#4 /usr/local/bin/phpcs(6): PHP_CodeSniffer\Runner->runPHPCS()
#5 {main}
thrown in phar:///usr/local/bin/phpcs/src/Config.php on line 2

Fatal error: Uncaught PHP_CodeSniffer\Exceptions\RuntimeException: Config file phar:///usr/local/bin/phpcs/src/../CodeSniffer.conf is not writable in phar:///usr/local/bin/phpcs/src/Config.php on line 2

PHP_CodeSniffer\Exceptions\RuntimeException: Config file phar:///usr/local/bin/phpcs/src/../CodeSniffer.conf is not writable in phar:///usr/local/bin/phpcs/src/Config.php on line 2

Call Stack:
0.0006 356360 1. {main}() /usr/local/bin/phpcs:0
0.0087 675168 2. PHP_CodeSniffer\Runner->runPHPCS() /usr/local/bin/phpcs:6
0.0109 888632 3. PHP_CodeSniffer\Config->__construct() phar:///usr/local/bin/phpcs/src/Runner.php:2
0.0206 915600 4. PHP_CodeSniffer\Config->setCommandLineValues() phar:///usr/local/bin/phpcs/src/Config.php:2
0.0206 915640 5. PHP_CodeSniffer\Config->processLongArgument() phar:///usr/local/bin/phpcs/src/Config.php:2
0.0207 915640 6. PHP_CodeSniffer\Config::setConfigData() phar:///usr/local/bin/phpcs/src/Config.php:2

The CodeSniffer.conf in /usr/local/bin works fine with phpcs v2.x.
(I've renamed the phpcs files only for showing the different behaviour!)

bildschirmfoto 2016-12-14 um 13 43 56

@gsherwood gsherwood changed the title phpcs 3.0.0rc2 CodeSniffer.conf error CodeSniffer.conf not working with 3.x PHAR file Dec 15, 2016
@gsherwood
Copy link
Member

The PAHR code was somehow removed, but it is back now and config settings are working again. Thanks for the bug report.

@guenti
Copy link
Author

guenti commented Dec 15, 2016

Wow, thank's for the quick fix. Works great now.

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