averias/phpredis-bloom

View on GitHub
src/RedisBloomClient/Command/CuckooFilter/CuckooFilterCommandTrait.php

Summary

Maintainability
B
4 hrs
Test Coverage
A
100%

Showing 2 of 2 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

public function cuckooFilterInsertIfNotExist(string $key, array $items, array $options = []): array
{
$this->validateArrayOfScalars($items, sprintf("%s params", BloomCommands::CF_INSERTNX));
$parsedOptions = $this->parseRequest(BloomCommands::CF_INSERTNX, $options);
$items = array_merge([OptionalParams::ITEMS], $items);
src/RedisBloomClient/Command/CuckooFilter/CuckooFilterCommandTrait.php on lines 52..60

Similar blocks of code found in 2 locations. Consider refactoring.
Open

public function cuckooFilterInsert(string $key, array $items, array $options = []): array
{
$this->validateArrayOfScalars($items, sprintf("%s params", BloomCommands::CF_INSERT));
$parsedOptions = $this->parseRequest(BloomCommands::CF_INSERT, $options);
$items = array_merge([OptionalParams::ITEMS], $items);
src/RedisBloomClient/Command/CuckooFilter/CuckooFilterCommandTrait.php on lines 65..73
Category
Status