Passed
Push — master ( ef59e7...9fe26e )
by Alexpts
01:49
created

File::connect()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 6
cts 6
cp 1
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 3
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace PTS\Transport;
5
6
class File extends Socket
7
{
8
9 3
    public function connect(string $address, int $port = 0, array $options = []): TransportInterface
10
    {
11 3
        $mode = $options['mode'] ?? 'a';
12 3
        $include_path = $options['use_include_path'] ?? false;
13 3
        $context = $options['context'] ?? null;
14
15 3
        $this->socket = fopen($address, $mode, $include_path, $context);
16
17 3
        return $this;
18
    }
19
}
20