PHP Code Standards: Difference between revisions

From PM Wiki
Jump to navigation Jump to search
Line 5: Line 5:
=== 1.a Local Variables ===
=== 1.a Local Variables ===


Local variables should be all lower case, ex. <pre>email</pre>
Local variable names should all be lower case, ex. <pre>email</pre>


If the local variable is made up of multiple words, use snake case, ex. <pre>email_address</pre>
If the local variable name is made up of multiple words, use snake case, ex. <pre>email_address</pre>
 
=== 1.b Classes ===
 
Class names should all be capitalized, ex. <pre>Vertical</pre>
 
If the class name is made up of multiple words, use snake case, but preserving the first word capitalization, ex. <pre>Vertical_groups</pre>

Revision as of 03:07, 26 October 2022

Popular Marketing Code Standards

1. Variable Naming Conventions

1.a Local Variables

Local variable names should all be lower case, ex.

email

If the local variable name is made up of multiple words, use snake case, ex.

email_address

1.b Classes

Class names should all be capitalized, ex.

Vertical

If the class name is made up of multiple words, use snake case, but preserving the first word capitalization, ex.

Vertical_groups