DeviceRequestUpdatedPassesEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 6
cts 6
cp 1
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 3
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LauLamanApps\ApplePassbookBundle\Event;
6
7
use DateTimeImmutable;
8
9
final class DeviceRequestUpdatedPassesEvent extends AbstractEvent
10
{
11
    /**
12
     * @var string
13
     */
14
    private $deviceLibraryIdentifier;
15
16
    /**
17
     * @var string
18
     */
19
    private $passTypeIdentifier;
20
21
    /**
22
     * @var DateTimeImmutable|null
23
     */
24
    private $passesUpdatedSince;
25
26
    /**
27
     * @var DateTimeImmutable|null
28
     */
29
    private $lastUpdated;
30
31
    /**
32
     * @var string[]
33
     */
34
    private $serialNumbers;
35
36 1
    public function __construct(
37
        string $deviceLibraryIdentifier,
38
        string $passTypeIdentifier,
39
        DateTimeImmutable $passesUpdatedSince = null
40
    ) {
41 1
        $this->deviceLibraryIdentifier = $deviceLibraryIdentifier;
42 1
        $this->passTypeIdentifier = $passTypeIdentifier;
43 1
        $this->passesUpdatedSince = $passesUpdatedSince;
44 1
        parent::__construct();
45 1
    }
46
47 1
    public function setSerialNumbers(array $serialNumbers, DateTimeImmutable $lastUpdated): void
48
    {
49 1
        $this->successful();
50 1
        $this->serialNumbers = $serialNumbers;
51 1
        $this->lastUpdated = $lastUpdated;
52 1
    }
53
54 1
    public function getDeviceLibraryIdentifier(): string
55
    {
56 1
        return $this->deviceLibraryIdentifier;
57
    }
58
59 1
    public function getPassTypeIdentifier(): string
60
    {
61 1
        return $this->passTypeIdentifier;
62
    }
63
64 1
    public function getPassesUpdatedSince(): ?DateTimeImmutable
65
    {
66 1
        return $this->passesUpdatedSince;
67
    }
68
69 1
    public function getLastUpdated(): ?DateTimeImmutable
70
    {
71 1
        return $this->lastUpdated;
72
    }
73
74 1
    public function getSerialNumbers(): array
75
    {
76 1
        return $this->serialNumbers;
77
    }
78
}
79