CreateNewUserPostHeaderDto   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 96
Duplicated Lines 0 %

Test Coverage

Coverage 90%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 96
ccs 18
cts 20
cp 0.9
rs 10
wmc 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A getTitle() 0 3 1
A getCreatedById() 0 3 1
A __construct() 0 10 1
A getVersion() 0 3 1
A getTags() 0 3 1
A getSummary() 0 3 1
A getCreatedByName() 0 3 1
A getId() 0 3 1
A getCreatedAt() 0 3 1
A getCommentsCount() 0 3 1
1
<?php
2
3
namespace App\Modules\Security\Domain\Dto;
4
5
use Symfony\Component\Uid\Ulid;
6
7
class CreateNewUserPostHeaderDto
8
{
9
    /**
10
     * @param Ulid $id
11
     * @param string $title
12
     * @param string $summary
13
     * @param array $tags
14
     * @param Ulid $createdById
15
     * @param string $createdByName
16
     * @param \DateTime $createdAt
17
     * @param int $version
18
     * @param int $commentsCount
19
     */
20 5
    public function __construct(private Ulid      $id,
21
                                private string    $title,
22
                                private string    $summary,
23
                                private array     $tags,
24
                                private Ulid      $createdById,
25
                                private string    $createdByName,
26
                                private \DateTime $createdAt,
27
                                private int       $version = 1,
28
                                private int       $commentsCount = 0)
29
    {
30 5
    }
31
32
    /**
33
     * @return Ulid
34
     */
35 5
    public function getId(): Ulid
36
    {
37 5
        return $this->id;
38
    }
39
40
41
    /**
42
     * @return string
43
     */
44 5
    public function getTitle(): string
45
    {
46 5
        return $this->title;
47
    }
48
49
    /**
50
     * @return string
51
     */
52 5
    public function getSummary(): string
53
    {
54 5
        return $this->summary;
55
    }
56
57
    /**
58
     * @return array
59
     */
60 5
    public function getTags(): array
61
    {
62 5
        return $this->tags;
63
    }
64
65
    /**
66
     * @return Ulid
67
     */
68 1
    public function getCreatedById(): Ulid
69
    {
70 1
        return $this->createdById;
71
    }
72
73
    /**
74
     * @return string
75
     */
76
    public function getCreatedByName(): string
77
    {
78
        return $this->createdByName;
79
    }
80
81
    /**
82
     * @return \DateTime
83
     */
84 5
    public function getCreatedAt(): \DateTime
85
    {
86 5
        return $this->createdAt;
87
    }
88
89
    /**
90
     * @return int
91
     */
92 5
    public function getVersion(): int
93
    {
94 5
        return $this->version;
95
    }
96
97
    /**
98
     * @return int
99
     */
100 5
    public function getCommentsCount(): int
101
    {
102 5
        return $this->commentsCount;
103
    }
104
105
}