Completed
Push — master ( 16d9dd...3a1fc2 )
by Sergey
02:19
created

Factory::createConnection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
nc 1
nop 2
dl 0
loc 3
c 0
b 0
f 0
cc 1
rs 10
1
<?php
2
3
namespace seregazhuk\React\Memcached;
4
5
use React\EventLoop\LoopInterface;
6
use React\Socket\Connector;
7
use seregazhuk\React\Memcached\Connection\Connection;
8
use seregazhuk\React\Memcached\Protocol\Parser;
9
10
class Factory
11
{
12
    /**
13
     * Creates a memcached client
14
     * @param LoopInterface $loop
15
     * @param string $address
16
     * @return Client
17
     */
18
    public static function createClient(LoopInterface $loop, $address = 'localhost:11211')
19
    {
20
        $connection = new Connection($address, new Connector($loop));
21
22
        return new Client($connection, new Parser());
23
    }
24
}
25