PHP Mess Detector did not allow private methods with underscore prefix

232 views Asked by At

I tested my code and encountered an error on mess detector. It seems like PHP Mess Detector did not allow private methods to be prefixed with underscore as it did not fulfil mess detector requirements, and stated that the methods shall be named in camelCase.

This is the error shown

/builds/Backend/bank-simulator/web/web/app/Http/Controllers/AlbPaymexController.php:138 CamelCaseMethodName The method _checkSignature is not named in camelCase. /builds/Backend/bank-simulator/web/web/app/Http/Controllers/AlbPaymexController.php:153 CamelCaseMethodName The method _generateSignature is not named in camelCase.

However, when I tried to change the method name to camelCase, Code Style will then show this error.

Code style error

138 | ERROR | Private method name "AlbPaymexController::checkSignature" must be prefixed with an underscore

153 | ERROR | Private method name "AlbPaymexController::generateSignature" must be prefixed with an underscore

I hope someone can help me on how to resolve this issue. Thanks!

0

There are 0 answers