Page tree

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

PSR-12: Extended Coding Style

  • Namespaces and classes MUST follow an “autoloading” PSR-0, PSR-4
  • Class names MUST be declared in StudlyCaps/PascalCase
  • CONSTANTS MUST be declared in all upper case with underscore separators
  • Method names MUST be declared in camelCase
  • Variable names MUST be written in camelCase and the name describe for what it is ($item = $termEntryTig)
  • UTF-8
  • Next file line delimiter: Unix
  • Tabs: 4 Spaces

Link to PSR-12 article: https://www.php-fig.org/psr/psr-12/

Principles:

  • YAGNI: You ain’t gonna need it (wiki)
  • KISS: Keep It Simple, Stupid (wiki)
  • DRY: Don’t Repeat Yourself (wiki)
  • SOLID: (wiki)
    - Single-Responsibility-Prinzip
    - Open-Closed-Prinzip
    - Liskovsches Substitutionsprinzip
    - Interface-Segregation-Prinzip
    - Dependency-Inversion-Prinzip


  • No labels