PostsBySearchRequestDto   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 71
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 1
A getTitle() 0 4 1
A getPublishedAt() 0 4 1
A getSummary() 0 4 1
A getSlug() 0 4 1
A getFullName() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Explicit Architecture POC,
7
 * which is created on top of the Symfony Demo application.
8
 *
9
 * (c) Herberto Graça <[email protected]>
10
 *
11
 * For the full copyright and license information, please view the LICENSE
12
 * file that was distributed with this source code.
13
 */
14
15
namespace Acme\App\Core\Component\Blog\Application\Query;
16
17
use Acme\PhpExtension\ConstructableFromArrayInterface;
18
use Acme\PhpExtension\ConstructableFromArrayTrait;
19
use DateTimeInterface;
20
21
/**
22
 * This is just a DTO, it only has getters, theres no logic to test, so we ignore it for code coverage purposes.
23
 *
24
 * @codeCoverageIgnore
25
 */
26
final class PostsBySearchRequestDto implements ConstructableFromArrayInterface
27
{
28
    use ConstructableFromArrayTrait;
29
30
    /**
31
     * @var string
32
     */
33
    private $title;
34
35
    /**
36
     * @var DateTimeInterface
37
     */
38
    private $publishedAt;
39
40
    /**
41
     * @var string
42
     */
43
    private $summary;
44
45
    /**
46
     * @var string
47
     */
48
    private $slug;
49
50
    /**
51
     * @var string
52
     */
53
    private $fullName;
54
55
    /**
56
     * @throws \Exception
57
     */
58
    public function __construct(
59
        string $title,
60
        DateTimeInterface $publishedAt,
61
        string $summary,
62
        string $slug,
63
        string $fullName
64
    ) {
65
        $this->title = $title;
66
        $this->publishedAt = $publishedAt;
67
        $this->summary = $summary;
68
        $this->slug = $slug;
69
        $this->fullName = $fullName;
70
    }
71
72
    public function getTitle(): string
73
    {
74
        return $this->title;
75
    }
76
77
    public function getPublishedAt(): DateTimeInterface
78
    {
79
        return $this->publishedAt;
80
    }
81
82
    public function getSummary(): string
83
    {
84
        return $this->summary;
85
    }
86
87
    public function getSlug(): string
88
    {
89
        return $this->slug;
90
    }
91
92
    public function getFullName(): string
93
    {
94
        return $this->fullName;
95
    }
96
}
97