Code Duplication    Length = 14-18 lines in 2 locations

src/Arrayy.php 2 locations

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