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   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 5
dl 0
loc 32
ccs 0
cts 19
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A refresh() 0 4 1
A enable() 0 4 1
A disable() 0 4 1
A restart() 0 8 1
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