ConnectionFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 7 1
1
<?php
2
3
namespace gries\Rcon;
4
5
/**
6
 * Class ConnectionFactory
7
 *
8
 * @package gries\Rcon
9
 */
10
class ConnectionFactory
11
{
12
    /**
13
     * Create a new RconConnection
14
     *
15
     * @param $host
16
     * @param $port
17
     * @param $password
18
     *
19
     * @return \gries\Rcon\Connection
20
     */
21
    public static function create($host, $port, $password)
22
    {
23
        $factory = new \Socket\Raw\Factory();
24
        $socket = $factory->createClient(sprintf('%s:%s', $host, $port));
25
26
        return new \gries\Rcon\Connection($socket, $password);
27
    }
28
}
29