Code Duplication    Length = 8-8 lines in 2 locations

lib/ConfigToken/TokenResolver/Types/ScopeTokenResolver.php 2 locations

@@ 279-286 (lines=8) @@
276
            throw new \Exception(sprintf('No scope was set for the %s resolver.', get_called_class()));
277
        }
278
        $path = explode($this->scopeLevelDelimiter, $pathStr);
279
        while (count($path) > 0) {
280
            $k = count($path)-1;
281
            if (trim($path[$k]) == '') {
282
                unset($path[$k]);
283
            } else {
284
                break;
285
            }
286
        }
287
        $scopePtr = &$this->scope;
288
        foreach ($path as $leaf) {
289
            if (array_key_exists($leaf, $scopePtr)) {
@@ 358-365 (lines=8) @@
355
            }
356
            throw new UnknownTokenException($token, $tokenName);
357
        }
358
        while (count($t) > 0) {
359
            $k = count($t) - 1;
360
            if (trim($t[$k]) == '') {
361
                unset($t[$k]);
362
            } else {
363
                break;
364
            }
365
        }
366
        if (count($t) != 2) {
367
            throw new TokenFormatException(sprintf('No path specified for scope reference token "%s".', $tokenName));
368
        }