| @@ 113-123 (lines=11) @@ | ||
| 110 | $namespace = ''; |
|
| 111 | $tokens = token_get_all(file_get_contents($filePath)); |
|
| 112 | for ($i = 0; $i < count($tokens); $i++) { |
|
| 113 | if ($tokens[$i][0] === T_NAMESPACE) { |
|
| 114 | for ($j = $i + 1; $j < count($tokens); $j++) { |
|
| 115 | if ($tokens[$j][0] === T_STRING) { |
|
| 116 | $namespace .= '\\' . $tokens[$j][1]; |
|
| 117 | } else { |
|
| 118 | if ($tokens[$j] === '{' || $tokens[$j] === ';') { |
|
| 119 | return $namespace; |
|
| 120 | } |
|
| 121 | } |
|
| 122 | } |
|
| 123 | } |
|
| 124 | } |
|
| 125 | return null; |
|
| 126 | } |
|
| @@ 154-164 (lines=11) @@ | ||
| 151 | continue; |
|
| 152 | } |
|
| 153 | for (; $i < count($tokens); $i++) { |
|
| 154 | if ($tokens[$i][0] === T_NAMESPACE) { |
|
| 155 | for ($j = $i + 1; $j < count($tokens); $j++) { |
|
| 156 | if ($tokens[$j][0] === T_STRING) { |
|
| 157 | $namespace .= '\\' . $tokens[$j][1]; |
|
| 158 | } else { |
|
| 159 | if ($tokens[$j] === '{' || $tokens[$j] === ';') { |
|
| 160 | break; |
|
| 161 | } |
|
| 162 | } |
|
| 163 | } |
|
| 164 | } |
|
| 165 | if ($tokens[$i][0] === T_CLASS) { |
|
| 166 | for ($j = $i + 1; $j < count($tokens); $j++) { |
|
| 167 | if ($tokens[$j] === '{') { |
|