GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 21abfc...40d55e )
by Anton
02:41
created

RunParams   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 22
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 1
A with() 0 8 1
1
<?php
2
3
namespace Deployer\Ssh;
4
5
class RunParams
6
{
7
    public function __construct(
8
        public ?string  $shell = null,
9
        public ?string $cwd = null,
10
        public ?array  $env = null,
11
        public ?string $dotenv = null,
12
        public bool    $nothrow = false,
13
        public ?int    $timeout = null,
14
        public ?int    $idleTimeout = null,
15
        public bool    $forceOutput = false,
16
        public ?array  $secrets = null,
17
    ) {}
18
19
    public function with(
20
        ?array $secrets = null,
21
        ?int $timeout = null,
22
    ): self {
23
        $params = clone $this;
24
        $params->secrets = array_merge($params->secrets ?? [], $secrets ?? []);
25
        $params->timeout = $timeout ?? $params->timeout;
26
        return $params;
27
    }
28
}
29