2017 © Pedro Peláez
 

project coding-standards

image

pressbooks/coding-standards

  • Friday, July 13, 2018
  • by greatislander
  • Repository
  • 1 Watchers
  • 0 Stars
  • 64 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Pressbooks Coding Standards

These are our coding standards. There are many like these, but these are ours., (*1)

Our standards are basically Human Made's coding standards with a few tweaks:, (*2)

  • Use camelCase for class methods & properties, UPPERCASE for class constants, snake_case everywhere else.
  • PHP Sessions are allowed.
  • A few more...

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:, (*3)

<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/, (*4)

The Versions

13/07 2018