Code Duplication    Length = 13-13 lines in 2 locations

src/InMemoryList/Infrastructure/Drivers/PdoDriver.php 1 location

@@ 66-78 (lines=13) @@
63
            'charset',
64
        ];
65
66
        foreach ($config as $param => $server) {
67
            if (is_array($server)) {
68
                foreach (array_keys($server) as $key) {
69
                    if (!in_array($key, $allowedConfigKeys)) {
70
                        throw new PdoMalformedConfigException();
71
                    }
72
                }
73
            }
74
75
            if (!is_array($server) && !in_array($param, $allowedConfigKeys)) {
76
                throw new PdoMalformedConfigException();
77
            }
78
        }
79
80
        $this->config = $config;
81
    }

src/InMemoryList/Infrastructure/Drivers/RedisDriver.php 1 location

@@ 75-87 (lines=13) @@
72
            'weight',
73
        ];
74
75
        foreach ($config as $param => $server) {
76
            if (is_array($server)) {
77
                foreach (array_keys($server) as $key) {
78
                    if (!in_array($key, $allowedConfigKeys)) {
79
                        throw new RedisMalformedConfigException();
80
                    }
81
                }
82
            }
83
84
            if (!is_array($server) && !in_array($param, $allowedConfigKeys)) {
85
                throw new RedisMalformedConfigException();
86
            }
87
        }
88
89
        $this->config = $config;
90
    }