Tag   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 51
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
A getId() 0 4 1
A getTitle() 0 4 1
1
<?php
2
/**
3
 * Lichtenwallner  (https://lichtenwallner.at)
4
 *
5
 * @see https://github.com/jolicht/markdown-cms for the canonical source repository
6
 * @license https://github.com/jolicht/markdown-cms/blob/master/LICENSE MIT
7
 * @copyright Copyright (c) Johannes Lichtenwallner
8
 */
9
declare(strict_types = 1);
10
namespace Jolicht\MarkdownCms\Taxonomy;
11
12
/**
13
 * Taxonomy for tagging blog entries
14
 */
15
class Tag
16
{
17
    /**
18
     * Id
19
     *
20
     * @var string
21
     */
22
    private $id;
23
24
    /**
25
     * Title
26
     *
27
     * @var string
28
     */
29
    private $title;
30
31
    /**
32
     * Constructor
33
     *
34
     * @param string $id
35
     * @param string $title
36
     */
37
    public function __construct(string $id, string $title = null)
38
    {
39
        $this->id = $id;
40
        $this->title = $title;
41
        if (null === $this->title) {
42
            $this->title = $id;
43
        }
44
    }
45
46
    /**
47
     * Get id
48
     *
49
     * @return string
50
     */
51
    public function getId() : string
52
    {
53
        return $this->id;
54
    }
55
56
    /**
57
     * Get title
58
     *
59
     * @return string
60
     */
61
    public function getTitle() : string
62
    {
63
        return $this->title;
64
    }
65
}