Code Duplication    Length = 14-18 lines in 2 locations

src/Arrayy.php 2 locations

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