Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 1.72 KB

development-best-practices.md

File metadata and controls

36 lines (25 loc) · 1.72 KB

Purpose

This document is designed to provide guidelines for the development and architecture of the CMS. None of the guidelines are hard rules and this document is a constant work in progress.

Integrations

  • All upstream integrations should be documented and monitored.
  • All downstream integrations should be documented.
  • Integrations with external systems should not occur in the direct flow of an editor.

Code Structure

  • The Event based versions of a hook using the hook_event_dispatcher should be used instead of the direct hook implementation.
  • All code which contains business logic must live in a class instead of a function.
  • Classes and methods should follow SOLID principles.
  • Methods containing business logic must have phpunit tests.
    • Value objects should be used instead of arrays to store data.

Code Readability

  • Code should be read as a story.
  • Comments should explain the why while the code explains the what/how.
  • Nested ifs should be avoided.
  • Nested foreach loops should be avoided.

inspired by Clean Code

Resources