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

PSR Default Configurations #43

Open jbrooksuk opened 10 years ago

jbrooksuk commented 10 years ago

We should add support for PSR-2 Coding Standards and potentially use this as the default standards if none are supplied.

jbrooksuk commented 10 years ago

I suggest that we do this after #27 so that the new files don't also need to be modified.

hafah commented 6 years ago

got this quite a lot on private functions:

name should follow the pattern /^_[a-z][a-zA-Z0-9]*$/

which is agains PSR-2 "4.3. Methods". So I wonder how to set phpcheckstyle to PSR-2

IGNBPesty commented 6 years ago

Yes, this is old school naming.

You can edit the config file and change the "privateFunctionNaming" rule to remove the underscore.

<test name="privateFunctionNaming" regexp="/^_[a-z][a-zA-Z0-9]*$/" level="error"/>

==>

<test name="privateFunctionNaming" regexp="/^[a-z][a-zA-Z0-9]*$/" level="error"/>