DeviceRegisteredEvent   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 72
Duplicated Lines 19.44 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 1
dl 14
loc 72
ccs 21
cts 21
cp 1
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 14 14 1
A getDeviceLibraryIdentifier() 0 4 1
A getPassTypeIdentifier() 0 4 1
A getSerialNumber() 0 4 1
A getAuthenticationToken() 0 4 1
A getPushToken() 0 4 1
A deviceRegistered() 0 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
declare(strict_types=1);
4
5
namespace LauLamanApps\ApplePassbookBundle\Event;
6
7
final class DeviceRegisteredEvent extends AbstractEvent
8
{
9
    /**
10
     * @var string
11
     */
12
    private $deviceLibraryIdentifier;
13
14
    /**
15
     * @var string
16
     */
17
    private $passTypeIdentifier;
18
19
    /**
20
     * @var string
21
     */
22
    private $serialNumber;
23
24
    /**
25
     * @var string
26
     */
27
    private $authenticationToken;
28
29
    /**
30
     * @var string
31
     */
32
    private $pushToken;
33
34 1 View Code Duplication
    public function __construct(
0 ignored issues
show
Duplication introduced by
This method 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...
35
        string $deviceLibraryIdentifier,
36
        string $passTypeIdentifier,
37
        string $serialNumber,
38
        string $authenticationToken,
39
        string $pushToken
40
    ) {
41 1
        parent::__construct();
42 1
        $this->deviceLibraryIdentifier = $deviceLibraryIdentifier;
43 1
        $this->passTypeIdentifier = $passTypeIdentifier;
44 1
        $this->serialNumber = $serialNumber;
45 1
        $this->authenticationToken = $authenticationToken;
46 1
        $this->pushToken = $pushToken;
47 1
    }
48
49 1
    public function getDeviceLibraryIdentifier(): string
50
    {
51 1
        return $this->deviceLibraryIdentifier;
52
    }
53
54 1
    public function getPassTypeIdentifier(): string
55
    {
56 1
        return $this->passTypeIdentifier;
57
    }
58
59 1
    public function getSerialNumber(): string
60
    {
61 1
        return $this->serialNumber;
62
    }
63
64 1
    public function getAuthenticationToken(): string
65
    {
66 1
        return $this->authenticationToken;
67
    }
68
69 1
    public function getPushToken(): string
70
    {
71 1
        return $this->pushToken;
72
    }
73
74 1
    public function deviceRegistered(): void
75
    {
76 1
        $this->successful();
77 1
    }
78
}
79