Skip to content

edinburghcouncil/standards

Repository files navigation

Coding Style Guide

The intent of this guide is to reduce cognitive friction when scanning code from different authors. It does so by enumerating a shared set of rules and expectations about how to format PHP code. Ideally, all code should appear as if written by one person.

It helps to have one set of guidelines to be used among all projects. Thus, the benefit of this guide is not in the rules themselves, but in the sharing of those rules.

The style rules herein are derived from the PHP Framework Interop Group PSR-2. By-and-large they are the same but they are PHP Standards Recommendations and, as such, have been amended in several places for pragmatic and practical purposes. PSR Please be professional and leave dogma at the door.

Rules have been written for PHP_CodeSniffer and are available in the Sniffs repository.

For brevity, the term “class” refers to all classes, interfaces, and traits throughout. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in these documents are to be interpreted as described in RFC 2119.

About

Coding standards, best practices and developer guidelines.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published