Code Duplication    Length = 14-18 lines in 2 locations

src/Arrayy.php 2 locations

@@ 7284-7297 (lines=14) @@
7281
        $reflector = new \ReflectionClass($this);
7282
        $factory = \phpDocumentor\Reflection\DocBlockFactory::createInstance();
7283
        $docComment = $reflector->getDocComment();
7284
        if ($docComment) {
7285
            $docblock = $factory->create($docComment);
7286
            /** @var \phpDocumentor\Reflection\DocBlock\Tags\Property $tag */
7287
            foreach ($docblock->getTagsByName('property') as $tag) {
7288
                $typeName = $tag->getVariableName();
7289
                /** @var string|null $typeName */
7290
                if ($typeName !== null) {
7291
                    $typeCheckPhpDoc = TypeCheckPhpDoc::fromPhpDocumentorProperty($tag, $typeName);
7292
                    if ($typeCheckPhpDoc !== null) {
7293
                        $properties[$typeName] = $typeCheckPhpDoc;
7294
                    }
7295
                }
7296
            }
7297
        }
7298
7299
        /** @noinspection PhpAssignmentInConditionInspection */
7300
        while ($reflector = $reflector->getParentClass()) {
@@ 7302-7319 (lines=18) @@
7299
        /** @noinspection PhpAssignmentInConditionInspection */
7300
        while ($reflector = $reflector->getParentClass()) {
7301
            $docComment = $reflector->getDocComment();
7302
            if ($docComment) {
7303
                $docblock = $factory->create($docComment);
7304
                /** @var \phpDocumentor\Reflection\DocBlock\Tags\Property $tag */
7305
                foreach ($docblock->getTagsByName('property') as $tag) {
7306
                    $typeName = $tag->getVariableName();
7307
                    /** @var string|null $typeName */
7308
                    if ($typeName !== null) {
7309
                        if (isset($properties[$typeName])) {
7310
                            continue;
7311
                        }
7312
7313
                        $typeCheckPhpDoc = TypeCheckPhpDoc::fromPhpDocumentorProperty($tag, $typeName);
7314
                        if ($typeCheckPhpDoc !== null) {
7315
                            $properties[$typeName] = $typeCheckPhpDoc;
7316
                        }
7317
                    }
7318
                }
7319
            }
7320
        }
7321
7322
        return $PROPERTY_CACHE[$cacheKey] = $properties;