1 | <?php |
||
33 | class DisallowSpaceIndentSniff implements Sniff |
||
34 | { |
||
35 | |||
36 | /** |
||
37 | * A list of tokenizers this sniff supports. |
||
38 | * |
||
39 | * @var array |
||
40 | */ |
||
41 | public $supportedTokenizers = array( |
||
42 | 'PHP', |
||
43 | 'JS', |
||
44 | 'CSS', |
||
45 | ); |
||
46 | |||
47 | |||
48 | /** |
||
49 | * Returns an array of tokens this test wants to listen for. |
||
50 | * |
||
51 | * @return array |
||
52 | */ |
||
53 | public function register() |
||
57 | |||
58 | |||
59 | /** |
||
60 | * Processes this test, when one of its tokens is encountered. |
||
61 | * |
||
62 | * @param File $phpcsFile All the tokens found in the document. |
||
63 | * @param int $stackPtr The position of the current token |
||
64 | * in the stack passed in $tokens. |
||
65 | * |
||
66 | * @return void |
||
67 | */ |
||
68 | public function process(File $phpcsFile, $stackPtr) |
||
83 | |||
84 | |||
85 | }//end class |
||
86 | |||
88 |
Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.
A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.