Factory::createClient()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
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
    public static function createClient(LoopInterface $loop, string $address = 'localhost:11211'): Client
13
    {
14
        $connection = new Connection($address, new Connector($loop));
15
16
        return new Client($connection, new Parser());
17
    }
18
}
19