Skip to content

Coding Guidelines

Ryan Cooley edited this page Nov 17, 2021 · 14 revisions

PHP Coding Standards

ProcessMaker follows the PSR-1 and PSR-12 PHP coding standards. Though we follow the entirety of these standards, the most important of these as well as ProcessMaker's own guidelines are summarized below.

ProcessMaker Coding Standards

  • For the sake of readability, shorthand comparisons using ternary operators MUST NOT be used.

  • All PHP files MUST use the Unix LF (linefeed) line ending only. All PHP files MUST end with a non-blank line, terminated with a single LF. The closing ?> tag MUST be omitted from files containing only PHP.

  • Code MUST use an indent of 4 spaces for each indent level, and MUST NOT use tabs for indenting.

  • Each individual trait that is imported into a class MUST be included one-per-line and each inclusion MUST have its own use import statement.

  • Visibility MUST be declared on all properties. Visibility MUST be declared on all constants if your project PHP minimum version supports constant visibilities (PHP 7.1 or later). The var keyword MUST NOT be used to declare a property.

Clone this wiki locally