Test Failed
Push — master ( 2c619e...495924 )
by Hirofumi
03:41
created

StoredJob::fifoGroupId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Shippinno\Job\Domain\Model;
4
5
use DateTimeImmutable;
6
7
class StoredJob
8
{
9
    /**
10
     * @var int|null
11
     */
12
    protected $id;
13
14
    /**
15
     * @var string
16
     */
17
    private $name;
18
19
    /**
20
     * @var string
21
     */
22
    private $body;
23
24
    /**
25
     * @var DateTimeImmutable
26
     */
27
    private $createdAt;
28
29
    /**
30
     * @var bool
31
     */
32
    private $isExpendable;
33
34
    /**
35
     * @var string|null
36
     */
37
    private $fifoGroupId;
38
39
    /**
40
     * @param string $name
41
     * @param string $body
42
     * @param DateTimeImmutable $createdAt
43
     */
44 10
    public function __construct(string $name, string $body, DateTimeImmutable $createdAt, bool $isExpendable, string $fifoGroupId = null)
45
    {
46 10
        $this->name = $name;
47 10
        $this->body = $body;
48 10
        $this->createdAt = $createdAt;
49 10
        $this->isExpendable = $isExpendable;
50 10
        $this->fifoGroupId = $fifoGroupId;
51 10
    }
52
53
    /**
54
     * @return int|null
55
     */
56 9
    public function id(): ?int
57
    {
58 9
        return $this->id;
59
    }
60
61
    /**
62
     * @return string
63
     */
64 6
    public function name(): string
65
    {
66 6
        return $this->name;
67
    }
68
69
    /**
70
     * @return string
71
     */
72 1
    public function body(): string
73
    {
74 1
        return $this->body;
75
    }
76
77
    /**
78
     * @return DateTimeImmutable
79
     */
80 1
    public function createdAt(): DateTimeImmutable
81
    {
82 1
        return $this->createdAt;
83
    }
84
85
    /**
86
     * @return bool
87
     */
88
    public function isExpendable(): bool
89
    {
90
        return $this->isExpendable;
91
    }
92
93
    /**
94
     * @return null|string
95
     */
96 2
    public function fifoGroupId(): ?string
97
    {
98 2
        return $this->fifoGroupId;
99
    }
100
}
101