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.

AddWebHookCommand   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 83
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 8 8 1
A getRepository() 4 4 1
A getName() 4 4 1
A getConfig() 4 4 1
A getEvents() 4 4 1
A isActive() 4 4 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Client\Github\CommandBus\Command\Repository;
4
5
use WyriHaximus\Tactician\CommandHandler\Annotations\Handler;
6
7
/**
8
 * @Handler("ApiClients\Client\Github\CommandBus\Handler\Repository\AddWebHookHandler")
9
 */
10 View Code Duplication
final class AddWebHookCommand
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12
    /**
13
     * @var string
14
     */
15
    private $repository;
16
17
    /**
18
     * @var string
19
     */
20
    private $name;
21
22
    /**
23
     * @var array
24
     */
25
    private $config;
26
27
    /**
28
     * @var array
29
     */
30
    private $events;
31
32
    /**
33
     * @var bool
34
     */
35
    private $active;
36
37
    /**
38
     * @param string $repository
39
     * @param string $name
40
     * @param array  $config
41
     * @param array  $events
42
     * @param bool   $active
43
     */
44 1
    public function __construct(string $repository, string $name, array $config, array $events, bool $active)
45
    {
46 1
        $this->repository = $repository;
47 1
        $this->name = $name;
48 1
        $this->config = $config;
49 1
        $this->events = $events;
50 1
        $this->active = $active;
51 1
    }
52
53
    /**
54
     * @return string
55
     */
56 1
    public function getRepository(): string
57
    {
58 1
        return $this->repository;
59
    }
60
61
    /**
62
     * @return string
63
     */
64 1
    public function getName(): string
65
    {
66 1
        return $this->name;
67
    }
68
69
    /**
70
     * @return array
71
     */
72 1
    public function getConfig(): array
73
    {
74 1
        return $this->config;
75
    }
76
77
    /**
78
     * @return array
79
     */
80 1
    public function getEvents(): array
81
    {
82 1
        return $this->events;
83
    }
84
85
    /**
86
     * @return bool
87
     */
88 1
    public function isActive(): bool
89
    {
90 1
        return $this->active;
91
    }
92
}
93