Code Duplication    Length = 14-18 lines in 2 locations

src/Arrayy.php 2 locations

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