Test Setup Failed
Push — master ( 246aa3...2d0e6f )
by Alexpts
01:50
created

File::connect()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 8
cts 8
cp 1
rs 9.8333
c 0
b 0
f 0
cc 2
nc 2
nop 2
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace PTS\Transport;
5
6
class File extends BaseTransport
7
{
8
9 8
    public function connect(string $address, array $options = []): static
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STATIC
Loading history...
10
    {
11 8
        $mode = $options['mode'] ?? 'a';
12 8
        $include_path = $options['use_include_path'] ?? false;
13 8
        $context = $options['context'] ?? null;
14
15 8
        $params = [$address, $mode, $include_path];
16 8
        $context && array_push($params, $context);
17
18 8
        $this->target = fopen(...$params);
19
20 8
        return $this;
21
    }
22
}
23