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

File   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 14
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A connect() 0 10 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