Passed
Push — master ( 7da4f0...e73242 )
by Hirofumi
04:58
created

StoredJob   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 42
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A id() 0 4 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
     * @param string $name
31
     * @param string $body
32
     * @param DateTimeImmutable $createdAt
33
     */
34 7
    public function __construct(string $name, string $body, DateTimeImmutable $createdAt)
35
    {
36 7
        $this->name = $name;
37 7
        $this->body = $body;
38 7
        $this->createdAt = $createdAt;
39 7
    }
40
41
    /**
42
     * @return int|null
43
     */
44 4
    public function id(): ?int
45
    {
46 4
        return $this->id;
47
    }
48
}
49