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.

TerminateEvent   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 4
Bugs 1 Features 1
Metric Value
c 4
b 1
f 1
dl 46
loc 46
wmc 4
lcom 0
cbo 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 5 5 1
A getCommand() 4 4 1
A setResponse() 4 4 1
A getResponse() 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
2
3
/**
4
 *
5
 * Copyright 2014 Simon Mönch.
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace APL\Event;
12
13
use APL\Response\ResponseInterface;
14
use APL\Command\CommandInterface;
15
use Symfony\Component\EventDispatcher\Event;
16
17
/**
18
 *
19
 * @author David Badura <[email protected]>
20
 */
21 View Code Duplication
class TerminateEvent extends Event
22
{
23
    /** @var CommandInterface */
24
    private $command;
25
26
    /** @var ResponseInterface */
27
    private $response;
28
29
    /**
30
     *
31
     * @param CommandInterface  $command
32
     * @param ResponseInterface $response
33
     */
34
    public function __construct(CommandInterface $command, ResponseInterface $response)
35
    {
36
        $this->command  = $command;
37
        $this->response = $response;
38
    }
39
40
    /**
41
     *
42
     * @param CommandInterface
43
     */
44
    public function getCommand()
45
    {
46
        return $this->command;
47
    }
48
49
    /**
50
     *
51
     * @param ResponseInterface $response
52
     */
53
    public function setResponse(ResponseInterface $response)
54
    {
55
        $this->response = $response;
56
    }
57
58
    /**
59
     *
60
     * @return ResponseInterface
61
     */
62
    public function getResponse()
63
    {
64
        return $this->response;
65
    }
66
}
67