PHP Code Standards: Difference between revisions
Jump to navigation
Jump to search
| Line 3: | Line 3: | ||
== Local Variables == | == Local Variables == | ||
Local variable names should all be lower case | Local variable names should all be lower case: <pre>email</pre> | ||
If the local variable name is made up of multiple words, use snake case | If the local variable name is made up of multiple words, use snake case: <pre>email_address</pre> | ||
== Functions == | |||
Function names should all be lowercase | Function names should all be lowercase: <pre>update</pre> | ||
If the function name is made up of multiple words, use snake case | If the function name is made up of multiple words, use snake case: <pre>update_by_id</pre> | ||
== Classes == | |||
Class names should all be capitalized: <pre>Vertical</pre> | Class names should all be capitalized: <pre>Vertical</pre> | ||
If the class name is made up of multiple words, use Pascal case: <pre>VerticalGroups</pre> | If the class name is made up of multiple words, use Pascal case: <pre>VerticalGroups</pre> | ||
Revision as of 16:22, 26 October 2022
Variable Naming Conventions
Local Variables
Local variable names should all be lower case:
If the local variable name is made up of multiple words, use snake case:
email_address
Functions
Function names should all be lowercase:
update
If the function name is made up of multiple words, use snake case:
update_by_id
Classes
Class names should all be capitalized:
Vertical
If the class name is made up of multiple words, use Pascal case:
VerticalGroups