Passed
Pull Request — master (#269)
by Christopher
03:14
created

ODataContainerBase   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 140
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 26
dl 0
loc 140
rs 10
c 1
b 0
f 0
wmc 11

11 Methods

Rating   Name   Duplication   Size   Complexity  
A setId() 0 4 1
A setUpdated() 0 4 1
A __construct() 0 7 1
A getSelfLink() 0 3 1
A setBaseURI() 0 4 1
A getBaseURI() 0 3 1
A getTitle() 0 3 1
A getId() 0 3 1
A getUpdated() 0 3 1
A setTitle() 0 4 1
A setSelfLink() 0 4 1
1
<?php
2
3
4
namespace POData\ObjectModel;
5
6
7
abstract class ODataContainerBase
8
{
9
    /**
10
     * Entry id.
11
     *
12
     * @var string|null
13
     */
14
    public $id;
15
    /**
16
     * Feed title.
17
     *
18
     * @var ODataTitle
19
     */
20
    public $title;
21
22
    /**
23
     * Entry Self Link.
24
     *
25
     * @var string|null
26
     */
27
    public $selfLink;
28
29
    /**
30
     * Last updated timestamp.
31
     *
32
     * @var string|null
33
     */
34
    public $updated;
35
36
    /**
37
     * Service Base URI.
38
     *
39
     * @var string|null
40
     */
41
    public $baseURI;
42
43
    /**
44
     * ODataContainerBase constructor.
45
     * @param string|null $id
46
     * @param ODataTitle $title
47
     * @param string|null $updated
48
     * @param string|null $baseURI
49
     */
50
    public function __construct(?string $id, ?ODataTitle $title, ?string $updated, ?string $baseURI)
51
    {
52
        $this
53
            ->setId($id)
54
            ->setTitle($title)
55
            ->setUpdated($updated)
56
            ->setBaseURI($baseURI);
57
    }
58
59
60
    /**
61
     * @return string|null
62
     */
63
    public function getId(): ?string
64
    {
65
        return $this->id;
66
    }
67
68
    /**
69
     * @param string|null $id
70
     * @return self
71
     */
72
    public function setId(?string $id): self
73
    {
74
        $this->id = $id;
75
        return $this;
76
    }
77
78
    /**
79
     * @return ODataTitle|null
80
     */
81
    public function getTitle(): ?ODataTitle
82
    {
83
        return $this->title;
84
    }
85
86
    /**
87
     * @param ODataTitle|null $title
88
     * @return self
89
     */
90
    public function setTitle(?ODataTitle $title): self
91
    {
92
        $this->title = $title;
93
        return $this;
94
    }
95
96
    /**
97
     * @return string|null
98
     */
99
    public function getSelfLink(): ?string
100
    {
101
        return $this->selfLink;
102
    }
103
104
    /**
105
     * @param string|null $selfLink
106
     * @return ODataEntry
107
     */
108
    public function setSelfLink(?string $selfLink): ODataEntry
109
    {
110
        $this->selfLink = $selfLink;
111
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type POData\ObjectModel\ODataContainerBase which includes types incompatible with the type-hinted return POData\ObjectModel\ODataEntry.
Loading history...
112
    }
113
    /**
114
     * @return string|null
115
     */
116
    public function getUpdated(): ?string
117
    {
118
        return $this->updated;
119
    }
120
121
    /**
122
     * @param string|null $updated
123
     * @return ODataEntry
124
     */
125
    public function setUpdated(?string $updated): self
126
    {
127
        $this->updated = $updated;
128
        return $this;
129
    }
130
131
    /**
132
     * @return string|null
133
     */
134
    public function getBaseURI(): ?string
135
    {
136
        return $this->baseURI;
137
    }
138
139
    /**
140
     * @param string|null $baseURI
141
     * @return self
142
     */
143
    public function setBaseURI(?string $baseURI): self
144
    {
145
        $this->baseURI = $baseURI;
146
        return $this;
147
    }
148
}