Template   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 17
dl 0
loc 71
rs 10
c 2
b 0
f 0
wmc 10

9 Methods

Rating   Name   Duplication   Size   Complexity  
A setLastModifiedToCurrentMoment() 0 3 1
A setLastModified() 0 5 1
A __toString() 0 3 2
A getSource() 0 3 1
A setSource() 0 5 1
A getId() 0 3 1
A setName() 0 5 1
A getName() 0 3 1
A getLastModified() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Alpha\TwigBundle\Entity;
6
7
class Template
8
{
9
    /**
10
     * @var int
11
     */
12
    protected $id;
13
14
    /**
15
     * @var string
16
     */
17
    protected $name;
18
19
    /**
20
     * @var string
21
     */
22
    protected $source;
23
24
    /**
25
     * @var \DateTimeImmutable
26
     */
27
    protected $lastModified;
28
29
    public function getId(): int
30
    {
31
        return $this->id;
32
    }
33
34
    public function setName(string $name): self
35
    {
36
        $this->name = $name;
37
38
        return $this;
39
    }
40
41
    public function getName(): ?string
42
    {
43
        return $this->name;
44
    }
45
46
    public function setSource(string $source): self
47
    {
48
        $this->source = $source;
49
50
        return $this;
51
    }
52
53
    public function getSource(): ?string
54
    {
55
        return $this->source;
56
    }
57
58
    public function setLastModified(\DateTimeImmutable $lastModified): self
59
    {
60
        $this->lastModified = $lastModified;
61
62
        return $this;
63
    }
64
65
    public function getLastModified(): ?\DateTimeImmutable
66
    {
67
        return $this->lastModified;
68
    }
69
70
    public function setLastModifiedToCurrentMoment(): void
71
    {
72
        $this->lastModified = new \DateTimeImmutable();
73
    }
74
75
    public function __toString(): string
76
    {
77
        return $this->getName() ?: '';
78
    }
79
}
80