Completed
Push — master ( 912266...b661a7 )
by Kirill
13:33
created

CompletedEvent   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 42
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 42
loc 42
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 11 11 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 Personnage\Tinkoff\SDK\Event;
4
5
use League\Event\AbstractEvent;
6
use Psr\Http\Message\RequestInterface;
7
use Psr\Http\Message\ResponseInterface;
8
9 View Code Duplication
final class CompletedEvent extends AbstractEvent
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...
10
{
11
    /**
12
     * @var RequestInterface
13
     */
14
    public $request;
15
16
    /**
17
     * @var ResponseInterface|null
18
     */
19
    public $response;
20
21
    /**
22
     * @var float
23
     */
24
    public $startedAt;
25
26
    /**
27
     * @var float
28
     */
29
    public $completedAt;
30
31
    /**
32
     * Init a new instance.
33
     *
34
     * @param float                   $startedAt
35
     * @param RequestInterface        $request
36
     * @param float                   $completedAt
37
     * @param ResponseInterface|null  $response
38
     */
39
    public function __construct(
40
        float $startedAt,
41
        RequestInterface $request,
42
        float $completedAt,
43
        ResponseInterface $response = null
44
    ) {
45
        $this->request = $request;
46
        $this->response = $response;
47
        $this->startedAt = $startedAt;
48
        $this->completedAt = $completedAt;
49
    }
50
}
51