Code Duplication    Length = 14-18 lines in 2 locations

src/Arrayy.php 2 locations

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