phpcheckstyle icon indicating copy to clipboard operation
phpcheckstyle copied to clipboard

PSR Default Configurations

Open jbrooksuk opened this issue 11 years ago • 3 comments

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

jbrooksuk avatar Sep 22 '14 12:09 jbrooksuk

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

jbrooksuk avatar Sep 24 '14 08:09 jbrooksuk

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

hafah avatar Mar 05 '18 13:03 hafah

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"/>

IGNBPesty avatar Mar 05 '18 16:03 IGNBPesty