Code Duplication    Length = 11-11 lines in 2 locations

src/phpFastCache/Drivers/Memcache/Driver.php 1 location

@@ 142-152 (lines=11) @@
139
    {
140
        $this->instance = new MemcacheSoftware();
141
        $servers = (!empty($this->config[ 'servers' ]) && is_array($this->config[ 'servers' ]) ? $this->config[ 'servers' ] : []);
142
        if (count($servers) < 1) {
143
            $servers = [
144
              [
145
                'host' => !empty($this->config[ 'host' ]) ? $this->config[ 'host' ] : '127.0.0.1',
146
                'path' => !empty($this->config[ 'path' ]) ? $this->config[ 'path' ] : false,
147
                'port' => !empty($this->config[ 'port' ]) ? $this->config[ 'port' ] : 11211,
148
                'sasl_user' => !empty($this->config[ 'sasl_user' ]) ? $this->config[ 'sasl_user' ] : false,
149
                'sasl_password' =>!empty($this->config[ 'sasl_password' ]) ? $this->config[ 'sasl_password' ]: false,
150
              ],
151
            ];
152
        }
153
154
        foreach ($servers as $server) {
155
            try {

src/phpFastCache/Drivers/Memcached/Driver.php 1 location

@@ 136-146 (lines=11) @@
133
        $this->instance = new MemcachedSoftware();
134
        $this->instance->setOption(\Memcached::OPT_BINARY_PROTOCOL, true);
135
        $servers = (!empty($this->config[ 'servers' ]) && is_array($this->config[ 'servers' ]) ? $this->config[ 'servers' ] : []);
136
        if (count($servers) < 1) {
137
            $servers = [
138
              [
139
                'host' => !empty($this->config[ 'host' ]) ? $this->config[ 'host' ] : '127.0.0.1',
140
                'path' => !empty($this->config[ 'path' ]) ? $this->config[ 'path' ] : false,
141
                'port' => !empty($this->config[ 'port' ]) ? $this->config[ 'port' ] : 11211,
142
                'sasl_user' => !empty($this->config[ 'sasl_user' ]) ? $this->config[ 'sasl_user' ] : false,
143
                'sasl_password' =>!empty($this->config[ 'sasl_password' ]) ? $this->config[ 'sasl_password' ]: false,
144
              ],
145
            ];
146
        }
147
148
        foreach ($servers as $server) {
149
            try {