Code Duplication    Length = 14-18 lines in 2 locations

src/Arrayy.php 2 locations

@@ 7144-7157 (lines=14) @@
7141
        $reflector = new \ReflectionClass($this);
7142
        $factory = \phpDocumentor\Reflection\DocBlockFactory::createInstance();
7143
        $docComment = $reflector->getDocComment();
7144
        if ($docComment) {
7145
            $docblock = $factory->create($docComment);
7146
            /** @var \phpDocumentor\Reflection\DocBlock\Tags\Property $tag */
7147
            foreach ($docblock->getTagsByName('property') as $tag) {
7148
                $typeName = $tag->getVariableName();
7149
                /** @var string|null $typeName */
7150
                if ($typeName !== null) {
7151
                    $typeCheckPhpDoc = TypeCheckPhpDoc::fromPhpDocumentorProperty($tag, $typeName);
7152
                    if ($typeCheckPhpDoc !== null) {
7153
                        $properties[$typeName] = $typeCheckPhpDoc;
7154
                    }
7155
                }
7156
            }
7157
        }
7158
7159
        /** @noinspection PhpAssignmentInConditionInspection */
7160
        while ($reflector = $reflector->getParentClass()) {
@@ 7162-7179 (lines=18) @@
7159
        /** @noinspection PhpAssignmentInConditionInspection */
7160
        while ($reflector = $reflector->getParentClass()) {
7161
            $docComment = $reflector->getDocComment();
7162
            if ($docComment) {
7163
                $docblock = $factory->create($docComment);
7164
                /** @var \phpDocumentor\Reflection\DocBlock\Tags\Property $tag */
7165
                foreach ($docblock->getTagsByName('property') as $tag) {
7166
                    $typeName = $tag->getVariableName();
7167
                    /** @var string|null $typeName */
7168
                    if ($typeName !== null) {
7169
                        if (isset($properties[$typeName])) {
7170
                            continue;
7171
                        }
7172
7173
                        $typeCheckPhpDoc = TypeCheckPhpDoc::fromPhpDocumentorProperty($tag, $typeName);
7174
                        if ($typeCheckPhpDoc !== null) {
7175
                            $properties[$typeName] = $typeCheckPhpDoc;
7176
                        }
7177
                    }
7178
                }
7179
            }
7180
        }
7181
7182
        return $PROPERTY_CACHE[$cacheKey] = $properties;