Completed
Pull Request — master (#269)
by Christopher
14:37
created

ODataTitle   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
eloc 12
dl 0
loc 64
rs 10
c 1
b 1
f 1
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setType() 0 4 1
A setTitle() 0 4 1
A getType() 0 3 1
A getTitle() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace POData\ObjectModel;
6
7
/**
8
 * Class ODataTitle.
9
 *
10
 * @package POData\ObjectModel
11
 */
12
class ODataTitle
13
{
14
15
    /**
16
     * Title.
17
     *
18
     * @var string
19
     */
20
    private $title;
21
22
    /**
23
     * Type.
24
     *
25
     * @var string
26
     */
27
    private $type;
28
29
    /**
30
     * ODataTitle constructor.
31
     *
32
     * @param string $title
33
     * @param string $type
34
     */
35
    public function __construct(string $title, string $type = 'text')
36
    {
37
        $this
38
            ->setTitle($title)
39
            ->setType($type);
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function getTitle(): string
46
    {
47
        return $this->title;
48
    }
49
50
    /**
51
     * @param  string     $title
52
     * @return ODataTitle
53
     */
54
    public function setTitle(string $title): ODataTitle
55
    {
56
        $this->title = $title;
57
        return $this;
58
    }
59
60
    /**
61
     * @return string
62
     */
63
    public function getType(): string
64
    {
65
        return $this->type;
66
    }
67
68
    /**
69
     * @param  string     $type
70
     * @return ODataTitle
71
     */
72
    public function setType(string $type): ODataTitle
73
    {
74
        $this->type = $type;
75
        return $this;
76
    }
77
}
78