You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
admin:~$ phpcs -i
PHP Fatal error: Uncaught UnexpectedValueException: DirectoryIterator::__construct(/Users/admin/projects/wpcs/:/usr/local/etc/php-code-sniffer/Standards): failed to open dir: No such file or directory in /usr/local/Cellar/php-code-sniffer/3.0.0/src/Util/Standards.php:84
Stack trace:
#0 /usr/local/Cellar/php-code-sniffer/3.0.0/src/Util/Standards.php(84): DirectoryIterator->__construct('/Users/admin/pr...')
#1 /usr/local/Cellar/php-code-sniffer/3.0.0/src/Config.php(219): PHP_CodeSniffer\Util\Standards::getInstalledStandards()
#2 /usr/local/Cellar/php-code-sniffer/3.0.0/src/Config.php(432): PHP_CodeSniffer\Config->__set('standards', Array)
#3 /usr/local/Cellar/php-code-sniffer/3.0.0/src/Config.php(323): PHP_CodeSniffer\Config->restoreDefaults()
#4 /usr/local/Cellar/php-code-sniffer/3.0.0/src/Runner.php(64): PHP_CodeSniffer\Config->__construct()
#5 /usr/local/Cellar/php-code-sniffer/3.0.0/bin/phpcs(18): PHP_CodeSniffer\Runner->runPHPCS()
#6 {main}
thrown in /usr/local/Cellar/php-code-sniffer/3.0.0/src/Util/Standards.php on line 84
Fatal error: Uncaught UnexpectedValueException: DirectoryIterator::__construct(/Users/admin/projects/wpcs/:/usr/local/etc/php-code-sniffer/Standards): failed to open dir: No such file or directory in /usr/local/Cellar/php-code-sniffer/3.0.0/src/Util/Standards.php on line 84
UnexpectedValueException: DirectoryIterator::__construct(/Users/admin/projects/wpcs/:/usr/local/etc/php-code-sniffer/Standards): failed to open dir: No such file or directory in /usr/local/Cellar/php-code-sniffer/3.0.0/src/Util/Standards.php on line 84
Call Stack:
0.0016 354664 1. {main}() /usr/local/Cellar/php-code-sniffer/3.0.0/bin/phpcs:0
0.0110 498144 2. PHP_CodeSniffer\Runner->runPHPCS() /usr/local/Cellar/php-code-sniffer/3.0.0/bin/phpcs:18
0.0158 738280 3. PHP_CodeSniffer\Config->__construct() /usr/local/Cellar/php-code-sniffer/3.0.0/src/Runner.php:64
0.0158 738680 4. PHP_CodeSniffer\Config->restoreDefaults() /usr/local/Cellar/php-code-sniffer/3.0.0/src/Config.php:323
0.0158 741296 5. PHP_CodeSniffer\Config->__set() /usr/local/Cellar/php-code-sniffer/3.0.0/src/Config.php:432
0.0173 766184 6. PHP_CodeSniffer\Util\Standards::getInstalledStandards() /usr/local/Cellar/php-code-sniffer/3.0.0/src/Config.php:219
0.0197 770848 7. DirectoryIterator->__construct() /usr/local/Cellar/php-code-sniffer/3.0.0/src/Util/Standards.php:84
I can't use --config-delete
admin:~$ phpcs --config-delete installed_paths
PHP Fatal error: Uncaught UnexpectedValueException: DirectoryIterator::__construct(/Users/admin/projects/wpcs/:/usr/local/etc/php-code-sniffer/Standards): failed to open dir: No such file or directory in /usr/local/Cellar/php-code-sniffer/3.0.0/src/Util/Standards.php:84
Stack trace:
#0 /usr/local/Cellar/php-code-sniffer/3.0.0/src/Util/Standards.php(84): DirectoryIterator->__construct('/Users/admin/pr...')
and I don't know what to do.
I can't find where the config file is located, or I'd just delete it or edit it by hand. How can I fix this?
The text was updated successfully, but these errors were encountered:
I found that the file name is CodeSniffer.conf and found where it was using Xdebug (/usr/local/Cellar/php-code-sniffer/3.0.0/CodeSniffer.conf, since I installed using Brew).
It would be convenient if instead of crashing, PHPCS would catch the error and maybe indicate which file the bad path came from.
gsherwood
changed the title
I set an invalid installed_paths and now I can't unset it
Setting an invalid installed path breaks all commnads
Jun 6, 2017
gsherwood
changed the title
Setting an invalid installed path breaks all commnads
Setting an invalid installed path breaks all commands
Jun 6, 2017
I'm glad you found the file and were able to resolve this manually. I've committed a fix so that invalid paths don't break PHPCS any more. Thanks for reporting this.
I tried to set two installed paths like so:
phpcs --config-set installed_paths ~/projects/wpcs/:/usr/local/etc/php-code-sniffer/Standards
And now everything is coming up:
I can't use
--config-delete
and I don't know what to do.
I can't find where the config file is located, or I'd just delete it or edit it by hand. How can I fix this?
The text was updated successfully, but these errors were encountered: