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

ODataExpandedResult::setEntry()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
declare(strict_types=1);
4
/**
5
 * Created by PhpStorm.
6
 * User: Barnso
7
 * Date: 16/08/2017
8
 * Time: 5:41 AM.
9
 */
10
namespace POData\ObjectModel;
11
12
/**
13
 * Class ODataExpandedResult.
14
 * @package POData\ObjectModel
15
 */
16
class ODataExpandedResult
17
{
18
    /**
19
     * Term.
20
     *
21
     * @var ODataContainerBase|null
22
     */
23
    private $data;
24
25
    /**
26
     * ODataExpandedResult constructor.
27
     *
28
     * @param ODataEntry|null $entry
29
     * @param ODataFeed|null  $feed
30
     */
31
    public function __construct(ODataContainerBase $data = null)
32
    {
33
        $this->data = $data;
34
    }
35
36
    /**
37
     * @return ODataEntry|null
38
     */
39
    public function getEntry(): ?ODataEntry
40
    {
41
        return $this->data instanceof ODataEntry ? $this->data : null;
42
    }
43
44
    /**
45
     * @param ODataEntry|null $entry
46
     * @return ODataExpandedResult
47
     */
48
    public function setEntry(?ODataEntry $entry): ODataExpandedResult
49
    {
50
        $this->entry = $entry;
0 ignored issues
show
Bug Best Practice introduced by
The property entry does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
51
        return $this;
52
    }
53
54
    /**
55
     * @return ODataFeed|null
56
     */
57
    public function getFeed(): ?ODataFeed
58
    {
59
        return $this->data instanceof ODataFeed ? $this->data : null;
60
    }
61
62
    /**
63
     * @param ODataFeed|null $feed
64
     * @return ODataExpandedResult
65
     */
66
    public function setFeed(?ODataFeed $feed): ODataExpandedResult
67
    {
68
        $this->feed = $feed;
0 ignored issues
show
Bug Best Practice introduced by
The property feed does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
69
        return $this;
70
    }
71
}
72