| 1 | <?php |
||
| 3 | class PHPCompatibility_Sniffs_PHP_ShortArraySniff extends PHPCompatibility_Sniff |
||
| 4 | { |
||
| 5 | /** @var array */ |
||
| 6 | protected $supportByVersion = array( |
||
| 7 | '5.3' => false, |
||
| 8 | '5.4' => true |
||
| 9 | ); |
||
| 10 | |||
| 11 | /** @var array */ |
||
| 12 | protected $errorByForbiddenTokens = array( |
||
| 13 | 'T_OPEN_SHORT_ARRAY' => 'Short array syntax (open)', |
||
| 14 | 'T_CLOSE_SHORT_ARRAY' => 'Short array syntax (close)' |
||
| 15 | ); |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Returns an array of tokens this test wants to listen for. |
||
| 19 | * |
||
| 20 | * @return array |
||
| 21 | */ |
||
| 22 | public function register() |
||
| 26 | |||
| 27 | |||
| 28 | /** |
||
| 29 | * Processes this test, when one of its tokens is encountered. |
||
| 30 | * |
||
| 31 | * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
||
| 32 | * @param int $stackPtr The position of the current token in |
||
| 33 | * the stack passed in $tokens. |
||
| 34 | * |
||
| 35 | * @return void |
||
| 36 | */ |
||
| 37 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
||
| 58 | |||
| 59 | }//end class |