Code Duplication    Length = 7-8 lines in 2 locations

source/Spiral/Tokenizer/Reflections/ReflectionFile.php 2 locations

@@ 387-394 (lines=8) @@
384
     */
385
    private function registerFunction($tokenID)
386
    {
387
        foreach ($this->declarations as $declarations) {
388
            foreach ($declarations as $location) {
389
                if ($tokenID >= $location[self::O_TOKEN] && $tokenID <= $location[self::C_TOKEN]) {
390
                    //We are inside class, function is method
391
                    return;
392
                }
393
            }
394
        }
395
396
        $localID = $tokenID + 1;
397
        while ($this->tokens[$localID][self::TOKEN_TYPE] != T_STRING) {
@@ 637-643 (lines=7) @@
634
     */
635
    private function activeDeclaration($tokenID)
636
    {
637
        foreach ($this->declarations as $declarations) {
638
            foreach ($declarations as $name => $position) {
639
                if ($tokenID >= $position[self::O_TOKEN] && $tokenID <= $position[self::C_TOKEN]) {
640
                    return $name;
641
                }
642
            }
643
        }
644
645
        //Can not be detected
646
        return null;