magento-ecg / coding-standard

Magento PHP_CodeSniffer Coding Standard
MIT License
308 stars 100 forks source link

Access level on Ecg_Sniffs_Security_ForbiddenFunctionSniff #9

Closed centerax closed 9 years ago

centerax commented 9 years ago

Getting this error while trying to run phpcs with this standard. Registering sniffs in the Ecg standard... PHP Fatal error: Access level to Ecg_Sniffs_Security_ForbiddenFunctionSniff::$forbiddenFunctions must be public (as in class Generic_Sniffs_PHP_ForbiddenFunctionsSniff) in vendor/magento-ecg/coding-standard/Ecg/Sniffs/Security/ForbiddenFunctionSniff.php on line 4

I changed that class property to public and it runs fine.

jzahedieh commented 9 years ago

:+1: I am getting this issue with phpcs 2.0.0 but it runs fine with 1.5.6

Skrath commented 9 years ago

I'm seeing this with 2.0 as well. I was having different issues before upgrading on 1.5.3

MagePsycho commented 9 years ago

I am also getting the same issue with phpcs (PHP_CodeSniffer version 2.0.0).

dshamis317 commented 9 years ago

Same here with PHPCS v.2.0.0. After changing those functions to public, it worked.

MagePsycho commented 9 years ago

Yay! Ecg_Sniffs_Security_ForbiddenFunctionSniff::protected $forbiddenFunctions -> public $forbiddenFunctions works.

yireo commented 9 years ago

Fix works perfectly for me too.