PHP Classes

File: zray/vendor/PHP_CodeSniffer-2.2.0/CodeSniffer/Standards/CodeIgniter/Docs/NamingConventions/ValidVariableNameStandard.xml

Recommend this page to a friend!
  Classes of Simo   CodeIgniter Plugin for Z-Ray   zray/vendor/PHP_CodeSniffer-2.2.0/CodeSniffer/Standards/CodeIgniter/Docs/NamingConventions/ValidVariableNameStandard.xml   Download  
File: zray/vendor/PHP_CodeSniffer-2.2.0/CodeSniffer/Standards/CodeIgniter/Docs/NamingConventions/ValidVariableNameStandard.xml
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: CodeIgniter Plugin for Z-Ray
Show CodeIgniter application information in Z-Ray
Author: By
Last change:
Date: 2 years ago
Size: 1,310 bytes
 

Contents

Class file image Download
<documentation title="Variable names"> <standard> <![CDATA[ Namely, variables should contain only lowercase letters, use underscore separators, and be reasonably named to indicate their purpose and contents. Very short, non-word variables should only be used as iterators in for() loops. Methods and variables that are only accessed internally by your class, such as utility and helper functions that your public methods use for code abstraction, should be prefixed with an underscore. ]]> </standard> <code_comparison> <code title="Examples of valid variable names"> <![CDATA[ for ($j = 0; $j < 10; $j++) $str $buffer $group_id $last_city private $_internal_data; ]]> </code> <code title="Examples of invalid variable names"> <![CDATA[ $j = 'foo'; // single letter variables should only be used in for() loops $Str // contains uppercase letters $bufferedText // uses CamelCasing, and could be shortened without losing semantic meaning $groupid // multiple words, needs underscore separator $name_of_last_city_used // too long private $internal_data; // not prefixed with an underscor, though private $_public_attribute; // prefixed with an underscor, though public ]]> </code> </code_comparison> </documentation>