Code Duplication    Length = 14-18 lines in 2 locations

src/Arrayy.php 2 locations

@@ 7148-7161 (lines=14) @@
7145
        $reflector = new \ReflectionClass($this);
7146
        $factory = \phpDocumentor\Reflection\DocBlockFactory::createInstance();
7147
        $docComment = $reflector->getDocComment();
7148
        if ($docComment) {
7149
            $docblock = $factory->create($docComment);
7150
            /** @var \phpDocumentor\Reflection\DocBlock\Tags\Property $tag */
7151
            foreach ($docblock->getTagsByName('property') as $tag) {
7152
                $typeName = $tag->getVariableName();
7153
                /** @var string|null $typeName */
7154
                if ($typeName !== null) {
7155
                    $typeCheckPhpDoc = TypeCheckPhpDoc::fromPhpDocumentorProperty($tag, $typeName);
7156
                    if ($typeCheckPhpDoc !== null) {
7157
                        $properties[$typeName] = $typeCheckPhpDoc;
7158
                    }
7159
                }
7160
            }
7161
        }
7162
7163
        /** @noinspection PhpAssignmentInConditionInspection */
7164
        while ($reflector = $reflector->getParentClass()) {
@@ 7166-7183 (lines=18) @@
7163
        /** @noinspection PhpAssignmentInConditionInspection */
7164
        while ($reflector = $reflector->getParentClass()) {
7165
            $docComment = $reflector->getDocComment();
7166
            if ($docComment) {
7167
                $docblock = $factory->create($docComment);
7168
                /** @var \phpDocumentor\Reflection\DocBlock\Tags\Property $tag */
7169
                foreach ($docblock->getTagsByName('property') as $tag) {
7170
                    $typeName = $tag->getVariableName();
7171
                    /** @var string|null $typeName */
7172
                    if ($typeName !== null) {
7173
                        if (isset($properties[$typeName])) {
7174
                            continue;
7175
                        }
7176
7177
                        $typeCheckPhpDoc = TypeCheckPhpDoc::fromPhpDocumentorProperty($tag, $typeName);
7178
                        if ($typeCheckPhpDoc !== null) {
7179
                            $properties[$typeName] = $typeCheckPhpDoc;
7180
                        }
7181
                    }
7182
                }
7183
            }
7184
        }
7185
7186
        return $PROPERTY_CACHE[$cacheKey] = $properties;