Code Duplication    Length = 14-18 lines in 2 locations

src/Arrayy.php 2 locations

@@ 7391-7404 (lines=14) @@
7388
        $reflector = new \ReflectionClass($this);
7389
        $factory = \phpDocumentor\Reflection\DocBlockFactory::createInstance();
7390
        $docComment = $reflector->getDocComment();
7391
        if ($docComment) {
7392
            $docblock = $factory->create($docComment);
7393
            /** @var \phpDocumentor\Reflection\DocBlock\Tags\Property $tag */
7394
            foreach ($docblock->getTagsByName('property') as $tag) {
7395
                $typeName = $tag->getVariableName();
7396
                /** @var string|null $typeName */
7397
                if ($typeName !== null) {
7398
                    $typeCheckPhpDoc = TypeCheckPhpDoc::fromPhpDocumentorProperty($tag, $typeName);
7399
                    if ($typeCheckPhpDoc !== null) {
7400
                        $properties[$typeName] = $typeCheckPhpDoc;
7401
                    }
7402
                }
7403
            }
7404
        }
7405
7406
        /** @noinspection PhpAssignmentInConditionInspection */
7407
        while ($reflector = $reflector->getParentClass()) {
@@ 7409-7426 (lines=18) @@
7406
        /** @noinspection PhpAssignmentInConditionInspection */
7407
        while ($reflector = $reflector->getParentClass()) {
7408
            $docComment = $reflector->getDocComment();
7409
            if ($docComment) {
7410
                $docblock = $factory->create($docComment);
7411
                /** @var \phpDocumentor\Reflection\DocBlock\Tags\Property $tag */
7412
                foreach ($docblock->getTagsByName('property') as $tag) {
7413
                    $typeName = $tag->getVariableName();
7414
                    /** @var string|null $typeName */
7415
                    if ($typeName !== null) {
7416
                        if (isset($properties[$typeName])) {
7417
                            continue;
7418
                        }
7419
7420
                        $typeCheckPhpDoc = TypeCheckPhpDoc::fromPhpDocumentorProperty($tag, $typeName);
7421
                        if ($typeCheckPhpDoc !== null) {
7422
                            $properties[$typeName] = $typeCheckPhpDoc;
7423
                        }
7424
                    }
7425
                }
7426
            }
7427
        }
7428
7429
        return $PROPERTY_CACHE[$cacheKey] = $properties;