| @@ 98-104 (lines=7) @@ | ||
| 95 | ||
| 96 | // Make sure this USE comes after the first namespace declaration. |
|
| 97 | $prev = $phpcsFile->findPrevious(T_NAMESPACE, ($stackPtr - 1)); |
|
| 98 | if ($prev !== false) { |
|
| 99 | $first = $phpcsFile->findNext(T_NAMESPACE, 1); |
|
| 100 | if ($prev !== $first) { |
|
| 101 | $error = 'USE declarations must go after the first namespace declaration'; |
|
| 102 | $phpcsFile->addError($error, $stackPtr, 'UseAfterNamespace'); |
|
| 103 | } |
|
| 104 | } |
|
| 105 | ||
| 106 | // Only interested in the last USE statement from here onwards. |
|
| 107 | $nextUse = $phpcsFile->findNext(T_USE, ($stackPtr + 1)); |
|
| @@ 128-134 (lines=7) @@ | ||
| 125 | ||
| 126 | // Make sure this USE comes after the first namespace declaration. |
|
| 127 | $prev = $phpcsFile->findPrevious(T_NAMESPACE, ($stackPtr - 1)); |
|
| 128 | if ($prev !== false) { |
|
| 129 | $first = $phpcsFile->findNext(T_NAMESPACE, 1); |
|
| 130 | if ($prev !== $first) { |
|
| 131 | $error = 'USE declarations must go after the first namespace declaration'; |
|
| 132 | $phpcsFile->addError($error, $stackPtr, 'UseAfterNamespace'); |
|
| 133 | } |
|
| 134 | } |
|
| 135 | ||
| 136 | // Only interested in the last USE statement from here onwards. |
|
| 137 | $nextUse = $phpcsFile->findNext(T_USE, ($stackPtr + 1)); |
|