Code Duplication    Length = 11-11 lines in 2 locations

src/reflection.php 2 locations

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