Skip to content

Dev.Coding Standard PHP

Taiwen Jiang edited this page Jul 14, 2013 · 22 revisions

PHP Coding Standard for Pi Engine

Overview

  • Scope
  • Goals
  • Conventions

#PHP File Formatting

General

Indentation

Maximum Line Length

Line Termination

Naming Conventions

Namespaces

Namespace Aliases

Classes

Abstract Classes

Interfaces

Filenames

Functions and Methods

Variables

Constants

Coding Style

PHP Code Demarcation

Strings

String Literals

String Literals Containing Apostrophes

Variable Substitution

String Concatenation

Class Names In Strings

Arrays

Numerically Indexed Arrays

Associative Arrays

Namespaces

Namespace Declaration

Import Statements

Classes

Class Declaration

Class Member Variables

Exceptions

Using Exceptions

Functions and Methods

Function and Method Declaration

Closure Definitions

Function and Method Usage

Control Statements

If/Else/Elseif

Switch

Inline Documentation

Documentation Format

General Notes

Files

Classes

Functions

Clone this wiki locally