Code Duplication    Length = 14-18 lines in 2 locations

src/Arrayy.php 2 locations

@@ 7286-7299 (lines=14) @@
7283
        $reflector = new \ReflectionClass($this);
7284
        $factory = \phpDocumentor\Reflection\DocBlockFactory::createInstance();
7285
        $docComment = $reflector->getDocComment();
7286
        if ($docComment) {
7287
            $docblock = $factory->create($docComment);
7288
            /** @var \phpDocumentor\Reflection\DocBlock\Tags\Property $tag */
7289
            foreach ($docblock->getTagsByName('property') as $tag) {
7290
                $typeName = $tag->getVariableName();
7291
                /** @var string|null $typeName */
7292
                if ($typeName !== null) {
7293
                    $typeCheckPhpDoc = TypeCheckPhpDoc::fromPhpDocumentorProperty($tag, $typeName);
7294
                    if ($typeCheckPhpDoc !== null) {
7295
                        $properties[$typeName] = $typeCheckPhpDoc;
7296
                    }
7297
                }
7298
            }
7299
        }
7300
7301
        /** @noinspection PhpAssignmentInConditionInspection */
7302
        while ($reflector = $reflector->getParentClass()) {
@@ 7304-7321 (lines=18) @@
7301
        /** @noinspection PhpAssignmentInConditionInspection */
7302
        while ($reflector = $reflector->getParentClass()) {
7303
            $docComment = $reflector->getDocComment();
7304
            if ($docComment) {
7305
                $docblock = $factory->create($docComment);
7306
                /** @var \phpDocumentor\Reflection\DocBlock\Tags\Property $tag */
7307
                foreach ($docblock->getTagsByName('property') as $tag) {
7308
                    $typeName = $tag->getVariableName();
7309
                    /** @var string|null $typeName */
7310
                    if ($typeName !== null) {
7311
                        if (isset($properties[$typeName])) {
7312
                            continue;
7313
                        }
7314
7315
                        $typeCheckPhpDoc = TypeCheckPhpDoc::fromPhpDocumentorProperty($tag, $typeName);
7316
                        if ($typeCheckPhpDoc !== null) {
7317
                            $properties[$typeName] = $typeCheckPhpDoc;
7318
                        }
7319
                    }
7320
                }
7321
            }
7322
        }
7323
7324
        return $PROPERTY_CACHE[$cacheKey] = $properties;