Code Duplication    Length = 14-18 lines in 2 locations

src/Arrayy.php 2 locations

@@ 7345-7358 (lines=14) @@
7342
        $reflector = new \ReflectionClass($this);
7343
        $factory = \phpDocumentor\Reflection\DocBlockFactory::createInstance();
7344
        $docComment = $reflector->getDocComment();
7345
        if ($docComment) {
7346
            $docblock = $factory->create($docComment);
7347
            /** @var \phpDocumentor\Reflection\DocBlock\Tags\Property $tag */
7348
            foreach ($docblock->getTagsByName('property') as $tag) {
7349
                $typeName = $tag->getVariableName();
7350
                /** @var string|null $typeName */
7351
                if ($typeName !== null) {
7352
                    $typeCheckPhpDoc = TypeCheckPhpDoc::fromPhpDocumentorProperty($tag, $typeName);
7353
                    if ($typeCheckPhpDoc !== null) {
7354
                        $properties[$typeName] = $typeCheckPhpDoc;
7355
                    }
7356
                }
7357
            }
7358
        }
7359
7360
        /** @noinspection PhpAssignmentInConditionInspection */
7361
        while ($reflector = $reflector->getParentClass()) {
@@ 7363-7380 (lines=18) @@
7360
        /** @noinspection PhpAssignmentInConditionInspection */
7361
        while ($reflector = $reflector->getParentClass()) {
7362
            $docComment = $reflector->getDocComment();
7363
            if ($docComment) {
7364
                $docblock = $factory->create($docComment);
7365
                /** @var \phpDocumentor\Reflection\DocBlock\Tags\Property $tag */
7366
                foreach ($docblock->getTagsByName('property') as $tag) {
7367
                    $typeName = $tag->getVariableName();
7368
                    /** @var string|null $typeName */
7369
                    if ($typeName !== null) {
7370
                        if (isset($properties[$typeName])) {
7371
                            continue;
7372
                        }
7373
7374
                        $typeCheckPhpDoc = TypeCheckPhpDoc::fromPhpDocumentorProperty($tag, $typeName);
7375
                        if ($typeCheckPhpDoc !== null) {
7376
                            $properties[$typeName] = $typeCheckPhpDoc;
7377
                        }
7378
                    }
7379
                }
7380
            }
7381
        }
7382
7383
        return $PROPERTY_CACHE[$cacheKey] = $properties;