squizlabs / PHP_CodeSniffer

PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
BSD 3-Clause "New" or "Revised" License
10.67k stars 1.48k forks source link

PHP Strict Error: Only variables should be passed by reference #587

Closed Konafets closed 9 years ago

Konafets commented 9 years ago

This happens in 3.0 branch

$ php --version
PHP 5.5.22 (cli) (built: Apr 12 2015 17:41:39)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
    with Xdebug v2.2.6, Copyright (c) 2002-2014, by Derick Rethans
    with Suhosin v0.9.36, Copyright (c) 2007-2014, by SektionEins GmbH

$ bin/phpcs -i
PHP Strict standards:  Only variables should be passed by reference in PHP_CodeSniffer_3-0/autoload.php on line 88
PHP Stack trace:
PHP   1. {main}() PHP_CodeSniffer_3-0/bin/phpcs:0
PHP   2. spl_autoload_call(*uninitialized*) PHP_CodeSniffer_3-0/bin/phpcs:12
PHP   3. PHP_CodeSniffer\Autoload::load($class = *uninitialized*) PHP_CodeSniffer_3-0/bin/phpcs:12
PHP   4. PHP_CodeSniffer\Autoload::loadFile($path = *uninitialized*) PHP_CodeSniffer_3-0/autoload.php:61
gsherwood commented 9 years ago

I'm on 5.5 as well and I can't replicate any errors. Any local changes? Any hints :smile: ?

Might also help if you could add var_dump($path); on line 59, which should give you:

$ bin/phpcs -i
string(xx) ".../PHP_CodeSniffer/src/Runner.php"
string(xx) ".../PHP_CodeSniffer/src/Util/Timing.php"
string(xx) ".../PHP_CodeSniffer/src/Config.php"
string(xx) ".../PHP_CodeSniffer/src/Util/Standards.php"
string(xx) ".../PHP_CodeSniffer/src/Util/Common.php"
The installed coding standards are MySource, PEAR, PHPCS, PSR1, PSR2, Squiz and Zend
gsherwood commented 9 years ago

Sorry, ignore me. I didn't have strict errors being shown when I thought I did.

gsherwood commented 9 years ago

I've fixed this up now.

Konafets commented 9 years ago

:+1: