Code Duplication    Length = 14-18 lines in 2 locations

src/Arrayy.php 2 locations

@@ 7158-7171 (lines=14) @@
7155
        $reflector = new \ReflectionClass($this);
7156
        $factory = \phpDocumentor\Reflection\DocBlockFactory::createInstance();
7157
        $docComment = $reflector->getDocComment();
7158
        if ($docComment) {
7159
            $docblock = $factory->create($docComment);
7160
            /** @var \phpDocumentor\Reflection\DocBlock\Tags\Property $tag */
7161
            foreach ($docblock->getTagsByName('property') as $tag) {
7162
                $typeName = $tag->getVariableName();
7163
                /** @var string|null $typeName */
7164
                if ($typeName !== null) {
7165
                    $typeCheckPhpDoc = TypeCheckPhpDoc::fromPhpDocumentorProperty($tag, $typeName);
7166
                    if ($typeCheckPhpDoc !== null) {
7167
                        $properties[$typeName] = $typeCheckPhpDoc;
7168
                    }
7169
                }
7170
            }
7171
        }
7172
7173
        /** @noinspection PhpAssignmentInConditionInspection */
7174
        while ($reflector = $reflector->getParentClass()) {
@@ 7176-7193 (lines=18) @@
7173
        /** @noinspection PhpAssignmentInConditionInspection */
7174
        while ($reflector = $reflector->getParentClass()) {
7175
            $docComment = $reflector->getDocComment();
7176
            if ($docComment) {
7177
                $docblock = $factory->create($docComment);
7178
                /** @var \phpDocumentor\Reflection\DocBlock\Tags\Property $tag */
7179
                foreach ($docblock->getTagsByName('property') as $tag) {
7180
                    $typeName = $tag->getVariableName();
7181
                    /** @var string|null $typeName */
7182
                    if ($typeName !== null) {
7183
                        if (isset($properties[$typeName])) {
7184
                            continue;
7185
                        }
7186
7187
                        $typeCheckPhpDoc = TypeCheckPhpDoc::fromPhpDocumentorProperty($tag, $typeName);
7188
                        if ($typeCheckPhpDoc !== null) {
7189
                            $properties[$typeName] = $typeCheckPhpDoc;
7190
                        }
7191
                    }
7192
                }
7193
            }
7194
        }
7195
7196
        return $PROPERTY_CACHE[$cacheKey] = $properties;