|
@@ 1091-1097 (lines=7) @@
|
| 1088 |
|
// This is a special case for PHP 5.6 use function and use const |
| 1089 |
|
// where "function" and "const" should be T_STRING instead of T_FUNCTION |
| 1090 |
|
// and T_CONST. |
| 1091 |
|
if (($newToken['code'] === T_FUNCTION |
| 1092 |
|
|| $newToken['code'] === T_CONST) |
| 1093 |
|
&& $finalTokens[$lastNotEmptyToken]['code'] === T_USE |
| 1094 |
|
) { |
| 1095 |
|
$newToken['code'] = T_STRING; |
| 1096 |
|
$newToken['type'] = 'T_STRING'; |
| 1097 |
|
} |
| 1098 |
|
|
| 1099 |
|
// This is a special case for use groups in PHP 7+ where leaving |
| 1100 |
|
// the curly braces as their normal tokens would confuse |
|
@@ 1102-1108 (lines=7) @@
|
| 1099 |
|
// This is a special case for use groups in PHP 7+ where leaving |
| 1100 |
|
// the curly braces as their normal tokens would confuse |
| 1101 |
|
// the scope map and sniffs. |
| 1102 |
|
if ($newToken['code'] === T_OPEN_CURLY_BRACKET |
| 1103 |
|
&& $finalTokens[$lastNotEmptyToken]['code'] === T_NS_SEPARATOR |
| 1104 |
|
) { |
| 1105 |
|
$newToken['code'] = T_OPEN_USE_GROUP; |
| 1106 |
|
$newToken['type'] = 'T_OPEN_USE_GROUP'; |
| 1107 |
|
$insideUseGroup = true; |
| 1108 |
|
} |
| 1109 |
|
|
| 1110 |
|
if ($insideUseGroup === true && $newToken['code'] === T_CLOSE_CURLY_BRACKET) { |
| 1111 |
|
$newToken['code'] = T_CLOSE_USE_GROUP; |