PHPCheckstyle / phpcheckstyle

PHPCheckstyle is an open-source tool that helps PHP programmers adhere to certain coding conventions.
https://github.com/PHPCheckstyle/phpcheckstyle
GNU Lesser General Public License v3.0
164 stars 31 forks source link

Bug Fix - fail to detect private functions with spaces after function… #81

Closed hc42 closed 7 years ago

hc42 commented 7 years ago

I debugged the _processFunctionStatement function and found out the reason for not detecting private function is the use of checkNextToken instead of checkNextValidToken. This caused whitespace to be the name of a private function instead of the real name if there is a space between function name and the open parenthesis. This fix solves the issue.

tchule commented 7 years ago

Nice, thanks a lot.