Completed
Pull Request — master (#17)
by
unknown
09:24
created

MemcachedConnector   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 18
rs 10
c 1
b 0
f 0
wmc 2
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A connect() 0 12 2
1
<?php
2
3
/**
4
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
6
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
7
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
8
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
9
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
10
 * THE SOFTWARE.
11
 */
12
namespace Ytake\LaravelCouchbase;
13
14
/**
15
 * Class MemcachedConnector
16
 * for couchbase memcached bucket
17
 */
18
class MemcachedConnector extends \Illuminate\Cache\MemcachedConnector
19
{
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function connect(array $servers)
24
    {
25
        $memcached = $this->getMemcached();
26
27
        foreach ($servers as $server) {
28
            $memcached->addServer(
29
                $server['host'], $server['port'], $server['weight']
30
            );
31
        }
32
33
        return $memcached;
34
    }
35
}
36