pressbooks / coding-standards

Pressbooks Coding Standards
GNU General Public License v3.0
2 stars 2 forks source link
coding-standards humanmade

Pressbooks Coding Standards

These are our coding standards. There are many like these, but these are ours.

Our standards are basically Human Made's coding standards with a few tweaks:

Tips

Pressbooks classes that extend WP Core classes will fail the PSR1.Methods.CamelCapsMethodName rule. In those cases, add something like this in your phpcs.ruleset.xml file:

<rule ref="PSR1.Methods.CamelCapsMethodName" >   
    <exclude-pattern>/inc/admin/class-catalog-list-table.php</exclude-pattern>
    <exclude-pattern>/inc/admin/class-network-managers-list-table.php</exclude-pattern>
    <exclude-pattern>/api/endpoints/controller/*</exclude-pattern>
</rule>

Link to docs: https://docs.pressbooks.org/coding-standards/