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

Depreated passing null to strtolower #95

Closed djculex closed 1 year ago

djculex commented 1 year ago

Hey there while trying to use your great script in a project I got an error while processing a page

Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in....class/PHPCheckstyle.php line 3377

I noticed function names, class names all as default is set to null

$this->_currentClassname = null;

Fix is replacing null with empty string ""

$this->_currentFunctionName = ""; $this->_currentClassname = ""; $this->_currentInterfacename = ""; $this->_currentFilename = ""; $this->_packageName = "";

tchule commented 1 year ago

Hello, thanks for the feedback.

I havn't touched the project in a while. I've just made an upgrade and tested with PHP 8.1 and PHPUnit 9, which should solve your issue. There may be a few regressions in the detection of some special rules.