1 | <?php |
||
26 | class CodingStandard_Sniffs_NamingConventions_ValidClassNameSniff implements PHP_CodeSniffer_Sniff |
||
|
|||
27 | { |
||
28 | |||
29 | /** |
||
30 | * A list of tokenizers this sniff supports. |
||
31 | * |
||
32 | * @var array |
||
33 | */ |
||
34 | public $supportedTokenizers = array('PHP'); |
||
35 | |||
36 | |||
37 | /** |
||
38 | * Returns an array of tokens this test wants to listen for. |
||
39 | * |
||
40 | * @return integer[] |
||
41 | */ |
||
42 | 1 | public function register() |
|
47 | |||
48 | |||
49 | /** |
||
50 | * Processes this test, when one of its tokens is encountered. |
||
51 | * |
||
52 | * @param PHP_CodeSniffer_File $phpcsFile All the tokens found in the document. |
||
53 | * @param int $stackPtr The position of the current token in |
||
54 | * the stack passed in $tokens. |
||
55 | * |
||
56 | * @return void |
||
57 | */ |
||
58 | 1 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
|
86 | |||
87 | |||
88 | }//end class |
||
89 |
Classes in PHP are usually named in CamelCase.
In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. The whole name starts with a capital letter as well.
Thus the name database provider becomes
DatabaseProvider
.