1 | <?php |
||
19 | class PHPCompatibility_Sniffs_PHP_InternalInterfacesSniff extends PHPCompatibility_Sniff |
||
20 | { |
||
21 | |||
22 | /** |
||
23 | * A list of PHP internal interfaces, not intended to be implemented by userland classes. |
||
24 | * |
||
25 | * The array lists : the error message to use. |
||
26 | * |
||
27 | * @var array(string => string) |
||
28 | */ |
||
29 | protected $internalInterfaces = array( |
||
30 | 'Traversable' => 'shouldn\'t be implemented directly, implement the Iterator or IteratorAggregate interface instead.', |
||
31 | 'DateTimeInterface' => 'is intended for type hints only and is not implementable.', |
||
32 | 'Throwable' => 'cannot be implemented directly, extend the Exception class instead.', |
||
33 | ); |
||
34 | |||
35 | |||
36 | /** |
||
37 | * Returns an array of tokens this test wants to listen for. |
||
38 | * |
||
39 | * @return array |
||
40 | */ |
||
41 | public function register() |
||
51 | |||
52 | |||
53 | /** |
||
54 | * Processes this test, when one of its tokens is encountered. |
||
55 | * |
||
56 | * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
||
57 | * @param int $stackPtr The position of the current token in |
||
58 | * the stack passed in $tokens. |
||
59 | * |
||
60 | * @return void |
||
61 | */ |
||
62 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
||
83 | |||
84 | }//end class |
||
85 |