1 | <?php |
||
23 | class CodingStandard_Sniffs_Files_OneTraitPerFileSniff implements PHP_CodeSniffer_Sniff |
||
|
|||
24 | { |
||
25 | |||
26 | |||
27 | /** |
||
28 | * Returns an array of tokens this test wants to listen for. |
||
29 | * |
||
30 | * @return integer[] |
||
31 | */ |
||
32 | public function register() |
||
37 | |||
38 | |||
39 | /** |
||
40 | * Processes this sniff, when one of its tokens is encountered. |
||
41 | * |
||
42 | * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
||
43 | * @param int $stackPtr The position of the current token in |
||
44 | * the stack passed in $tokens. |
||
45 | * |
||
46 | * @return void |
||
47 | */ |
||
48 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
||
57 | |||
58 | |||
59 | }//end class |
||
60 |
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
.