1 | <?php |
||
25 | class CodingStandard_Sniffs_WhiteSpace_CommaSpacingSniff implements PHP_CodeSniffer_Sniff |
||
|
|||
26 | { |
||
27 | |||
28 | |||
29 | /** |
||
30 | * Returns an array of tokens this test wants to listen for. |
||
31 | * |
||
32 | * @return array |
||
33 | */ |
||
34 | public function register() |
||
39 | |||
40 | |||
41 | /** |
||
42 | * Processes this test, when one of its tokens is encountered. |
||
43 | * |
||
44 | * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
||
45 | * @param int $stackPtr The position of the current token |
||
46 | * in the stack passed in $tokens. |
||
47 | * |
||
48 | * @return void |
||
49 | */ |
||
50 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
||
56 | |||
57 | /** |
||
58 | * Checks spacing before comma. |
||
59 | * |
||
60 | * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
||
61 | * @param int $stackPtr The position of the current token |
||
62 | * in the stack passed in $tokens. |
||
63 | * |
||
64 | * @return void |
||
65 | */ |
||
66 | public function checkContentBefore(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
||
84 | |||
85 | /** |
||
86 | * Checks spacing after comma. |
||
87 | * |
||
88 | * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
||
89 | * @param int $stackPtr The position of the current token |
||
90 | * in the stack passed in $tokens. |
||
91 | * |
||
92 | * @return void |
||
93 | */ |
||
94 | public function checkContentAfter(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
||
130 | |||
131 | }//end class |
||
132 |
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
.