Pregunta

Me postulo esta phpcs comando para comprobar un archivo. Estoy consiguiendo este error.

ubuntu@myip:/var/www/ryapi$ phpcs -n content.php
PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/mcrypt.ini on line 1 in Unknown on line 0
PHP Fatal error:  Uncaught PHP_CodeSniffer_Exception: $stackPtr is not a class member var in /usr/share/php/PHP/CodeSniffer/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php on line 51
#0 /usr/share/php/PHP/CodeSniffer/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php(51): PHP_CodeSniffer_File->getMemberProperties(30)
#1 /usr/share/php/PHP/CodeSniffer/Standards/AbstractVariableSniff.php(154): PEAR_Sniffs_NamingConventions_ValidVariableNameSniff->processMemberVar(Object(PHP_CodeSniffer_File), 30)
#2 /usr/share/php/PHP/CodeSniffer/Standards/AbstractScopeSniff.php(190): PHP_CodeSniffer_Standards_AbstractVariableSniff->processTokenWithinScope(Object(PHP_CodeSniffer_File), 30, 21)
#3 /usr/share/php/PHP/CodeSniffer/File.php(431): PHP_CodeSniffer_Standards_AbstractScopeSniff->process(Object(PHP_CodeSniffer_File), 30)
#4 /usr/share/php/PHP/CodeSniffer.php(900): PHP_CodeSniffer_File->start(NULL)
#5 /usr/share/php/PHP/CodeSniffer.php(815): PHP_CodeSniffer->_processFile('/var/www/ryapi/...', NULL)
¿Fue útil?

Solución

Al migrar a PHP 5.3 comentarios en los archivos ini ya no se les permite empezar con el #.

Ir a /etc/php5/cli/conf.d/mcrypt.ini y el uso ; en lugar de #, esto es un error por defecto en el último Ubuntu (5.3.2-1ubuntu4.7).

O establecer la configuración de error en PHP para ignorar los avisos en desuso como esto

error_reporting(E_ALL  &~ (E_STRICT|E_NOTICE|E_DEPRECATED));
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top