RegisterEntry::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 1
cts 1
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Matks\MarkdownBlogBundle\Blog\Register;
4
5
use Matks\MarkdownBlogBundle\Blog\Post;
6
7
class RegisterEntry
8
{
9
    /**
10
     * @var string
11
     */
12
    private $name;
13
14
    /**
15
     * @var string|null
16
     */
17
    private $publishDate;
18
19
    /**
20
     * @var string|null
21
     */
22
    private $category;
23
24
    /**
25
     * @var string[]
26
     */
27
    private $tags;
28
29
    /**
30
     * Might be used to override post name display.
31
     *
32
     * @var string|null
33
     */
34
    private $alias;
35
36
    /**
37
     * @var string
38
     */
39
    private $blogType;
40
41
    /**
42
     * @var string
43
     */
44
    private $url;
45
46
    /**
47
     * @param string   $name
48
     * @param string   $publishDate
49
     * @param string   $category
50
     * @param string[] $tags
51
     * @param string   $alias
52
     * @param string   $blogType
53
     * @param string   $url
54
     */
55
    public function __construct($name, $publishDate = null, $category = null, $tags = [], $alias = null, $blogType = Post::TYPE_STANDARD, $url = null)
56
    {
57 1
        $this->category    = $category;
58 1
        $this->name        = $name;
59 1
        $this->publishDate = $publishDate;
60 1
        $this->tags        = $tags;
61 1
        $this->alias       = $alias;
62 1
        $this->blogType    = $blogType;
63 1
        $this->url         = $url;
64 1
    }
65
66
    /**
67
     * @return string|null
68
     */
69
    public function getCategory()
70
    {
71
        return $this->category;
72
    }
73
74
    /**
75
     * @return string
76
     */
77
    public function getName()
78
    {
79 1
        return $this->name;
80
    }
81
82
    /**
83
     * @return string|null
84
     */
85
    public function getPublishDate()
86
    {
87
        return $this->publishDate;
88
    }
89
90
    /**
91
     * @return string[]
92
     */
93
    public function getTags()
94
    {
95
        return $this->tags;
96
    }
97
98
    /**
99
     * @return string|null
100
     */
101
    public function getAlias()
102
    {
103
        return $this->alias;
104
    }
105
106
    /**
107
     * @return string
108
     */
109
    public function getBlogType()
110
    {
111
        return $this->blogType;
112
    }
113
114
    /**
115
     * @return string
116
     */
117
    public function getUrl()
118
    {
119
        return $this->url;
120
    }
121
}
122