Code Duplication    Length = 14-18 lines in 2 locations

src/Arrayy.php 2 locations

@@ 7046-7059 (lines=14) @@
7043
        $reflector = new \ReflectionClass($this);
7044
        $factory = \phpDocumentor\Reflection\DocBlockFactory::createInstance();
7045
        $docComment = $reflector->getDocComment();
7046
        if ($docComment) {
7047
            $docblock = $factory->create($docComment);
7048
            /** @var \phpDocumentor\Reflection\DocBlock\Tags\Property $tag */
7049
            foreach ($docblock->getTagsByName('property') as $tag) {
7050
                $typeName = $tag->getVariableName();
7051
                /** @var string|null $typeName */
7052
                if ($typeName !== null) {
7053
                    $typeCheckPhpDoc = TypeCheckPhpDoc::fromPhpDocumentorProperty($tag, $typeName);
7054
                    if ($typeCheckPhpDoc !== null) {
7055
                        $properties[$typeName] = $typeCheckPhpDoc;
7056
                    }
7057
                }
7058
            }
7059
        }
7060
7061
        /** @noinspection PhpAssignmentInConditionInspection */
7062
        while ($reflector = $reflector->getParentClass()) {
@@ 7064-7081 (lines=18) @@
7061
        /** @noinspection PhpAssignmentInConditionInspection */
7062
        while ($reflector = $reflector->getParentClass()) {
7063
            $docComment = $reflector->getDocComment();
7064
            if ($docComment) {
7065
                $docblock = $factory->create($docComment);
7066
                /** @var \phpDocumentor\Reflection\DocBlock\Tags\Property $tag */
7067
                foreach ($docblock->getTagsByName('property') as $tag) {
7068
                    $typeName = $tag->getVariableName();
7069
                    /** @var string|null $typeName */
7070
                    if ($typeName !== null) {
7071
                        if (isset($properties[$typeName])) {
7072
                            continue;
7073
                        }
7074
7075
                        $typeCheckPhpDoc = TypeCheckPhpDoc::fromPhpDocumentorProperty($tag, $typeName);
7076
                        if ($typeCheckPhpDoc !== null) {
7077
                            $properties[$typeName] = $typeCheckPhpDoc;
7078
                        }
7079
                    }
7080
                }
7081
            }
7082
        }
7083
7084
        return $PROPERTY_CACHE[$cacheKey] = $properties;