Coding Standard (PHP) - WhiteCloud27/Admission-Management-System GitHub Wiki

Naming Convention

Variable Name

Variable name should follow Camel Casing.
Example:
studentName, studentRegistrationNumber.

Constant Name

Constants should be written in all capital letters with underscores separating words.
Example:
MAX_OVERFLOW

Method Name

Method name should follow camel casing.
Example:
myFunction()

Package and Module Name

Package or module name should be in lower case and short. For multiple word variable the name should be in lower case with underscores".
Example:
my_pack

Class Name

Class names should normally use the Pascal Casing convention.
Example:
class MyClass

Member Order

This member order will be used.....

Constants
public const
protected const
private const

Properties
public static properties
public properties
protected static properties
protected properties
private static properties
private properties

Methods
magic methods
public static methods
public methods
protected static methods
protected methods
private static methods
private methods

Interface Name

Interface name should be started with "I" as a prefix and should follow Pascal Casing convention.

Exception Name

Exception Names should follow Pascal Casing convention and suffix "Error" (if the exception actually is an error).

Layout Convention

* A white-space should be added around operators, like +, -, ==, etc.
* Parentheses will be always used after keywords if, else, do, while, for.
* Opening and closing parenthesis should be on a new line
⚠️ **GitHub.com Fallback** ⚠️