Code Duplication    Length = 14-18 lines in 2 locations

src/Arrayy.php 2 locations

@@ 7060-7073 (lines=14) @@
7057
        $reflector = new \ReflectionClass($this);
7058
        $factory = \phpDocumentor\Reflection\DocBlockFactory::createInstance();
7059
        $docComment = $reflector->getDocComment();
7060
        if ($docComment) {
7061
            $docblock = $factory->create($docComment);
7062
            /** @var \phpDocumentor\Reflection\DocBlock\Tags\Property $tag */
7063
            foreach ($docblock->getTagsByName('property') as $tag) {
7064
                $typeName = $tag->getVariableName();
7065
                /** @var string|null $typeName */
7066
                if ($typeName !== null) {
7067
                    $typeCheckPhpDoc = TypeCheckPhpDoc::fromPhpDocumentorProperty($tag, $typeName);
7068
                    if ($typeCheckPhpDoc !== null) {
7069
                        $properties[$typeName] = $typeCheckPhpDoc;
7070
                    }
7071
                }
7072
            }
7073
        }
7074
7075
        /** @noinspection PhpAssignmentInConditionInspection */
7076
        while ($reflector = $reflector->getParentClass()) {
@@ 7078-7095 (lines=18) @@
7075
        /** @noinspection PhpAssignmentInConditionInspection */
7076
        while ($reflector = $reflector->getParentClass()) {
7077
            $docComment = $reflector->getDocComment();
7078
            if ($docComment) {
7079
                $docblock = $factory->create($docComment);
7080
                /** @var \phpDocumentor\Reflection\DocBlock\Tags\Property $tag */
7081
                foreach ($docblock->getTagsByName('property') as $tag) {
7082
                    $typeName = $tag->getVariableName();
7083
                    /** @var string|null $typeName */
7084
                    if ($typeName !== null) {
7085
                        if (isset($properties[$typeName])) {
7086
                            continue;
7087
                        }
7088
7089
                        $typeCheckPhpDoc = TypeCheckPhpDoc::fromPhpDocumentorProperty($tag, $typeName);
7090
                        if ($typeCheckPhpDoc !== null) {
7091
                            $properties[$typeName] = $typeCheckPhpDoc;
7092
                        }
7093
                    }
7094
                }
7095
            }
7096
        }
7097
7098
        return $PROPERTY_CACHE[$cacheKey] = $properties;