TcpSocketFactory::createClient()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace PhpSchool\LearnYouPhp;
4
5
use Hoa\Socket\Client;
6
7
/**
8
 * Class SocketFactory
9
 * @package PhpSchool\LearnYouPhp
10
 * @author Aydin Hassan <[email protected]>
11
 */
12
class TcpSocketFactory
13
{
14
    /**
15
     * @param string $ip
16
     * @param int $port
17
     * @return Client
18
     */
19
    public function createClient($ip, $port)
20
    {
21
        return new Client(sprintf('tcp://%s:%d', $ip, $port));
22
    }
23
}
24