File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
WordPress/Docs/NamingConventions Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+ <documentation xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3+ xsi : noNamespaceSchemaLocation =" https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd"
4+ title =" Valid Variable Name"
5+ >
6+ <standard >
7+ <![CDATA[
8+ Use lowercase letters in variable names. Separate words using underscores.
9+ ]]>
10+ </standard >
11+ <code_comparison >
12+ <code title =" Valid: Lowercase variable name." >
13+ <![CDATA[
14+ <em>$prefix_variable_name</em> = 'value';
15+
16+ echo <em>$prefix_variable_name</em>;
17+ ]]>
18+ </code >
19+ <code title =" Invalid: Mixed case function name." >
20+ <![CDATA[
21+ <em>$Prefix_Variable_NAME</em> = 'value';
22+
23+ echo <em>$Prefix_Variable_NAME</em>;
24+ ]]>
25+ </code >
26+ </code_comparison >
27+ <code_comparison >
28+ <code title =" Valid: Words separated by underscores." >
29+ <![CDATA[
30+ class My_Class {
31+ public <em>$property_name</em> = 'value';
32+ }
33+ ]]>
34+ </code >
35+ <code title =" Invalid: Using camel case to separate words." >
36+ <![CDATA[
37+ class My_Class {
38+ public <em>$propertyName</em> = 'value';
39+ }
40+ ]]>
41+ </code >
42+ </code_comparison >
43+ </documentation >
You can’t perform that action at this time.
0 commit comments