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.

Program::disable()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Client\Supervisord\Resource\Async;
4
5
use ApiClients\Client\Supervisord\CommandBus\Command\Program\StartCommand;
6
use ApiClients\Client\Supervisord\CommandBus\Command\Program\StopCommand;
7
use ApiClients\Client\Supervisord\CommandBus\Command\ProgramCommand;
8
use ApiClients\Client\Supervisord\Resource\Program as BaseProgram;
9
use React\Promise\PromiseInterface;
10
11
class Program extends BaseProgram
12
{
13
    public function refresh(): PromiseInterface
14
    {
15
        return $this->handleCommand(new ProgramCommand($this->name));
16
    }
17
18
    /**
19
     * Reason behind the enable/disable names is that start is in
20
     * use by an property.
21
     *
22
     * @return PromiseInterface
23
     */
24
    public function enable(): PromiseInterface
25
    {
26
        return $this->handleCommand(new StartCommand($this->name));
27
    }
28
29
    public function disable(): PromiseInterface
30
    {
31
        return $this->handleCommand(new StopCommand($this->name));
32
    }
33
34
    public function restart(): PromiseInterface
35
    {
36
        return $this->disable()->then(function () {
37
            return $this->enable();
38
        })->then(function () {
39
            return $this->refresh();
40
        });
41
    }
42
}
43