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

ODataCategory::setTerm()   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
namespace POData\ObjectModel;
6
7
/**
8
 * Class ODataCategory.
9
 * @package POData\ObjectModel
10
 */
11
class ODataCategory
12
{
13
    /**
14
     * Term.
15
     *
16
     * @var string
17
     */
18
    private $term;
19
20
    /**
21
     * Scheme.
22
     *
23
     * @var string
24
     */
25
    private $scheme;
26
27
    /**
28
     * ODataCategory constructor.
29
     *
30
     * @param        $term
31
     * @param string $scheme
32
     */
33
    public function __construct($term, $scheme = 'http://schemas.microsoft.com/ado/2007/08/dataservices/scheme')
34
    {
35
        $this
36
            ->setTerm($term)
37
            ->setScheme($scheme);
38
39
    }
40
41
    /**
42
     * @return string
43
     */
44
    public function getTerm(): string
45
    {
46
        return $this->term;
47
    }
48
49
    /**
50
     * @param string $term
51
     * @return ODataCategory
52
     */
53
    public function setTerm(string $term): ODataCategory
54
    {
55
        $this->term = $term;
56
        return $this;
57
    }
58
59
    /**
60
     * @return string
61
     */
62
    public function getScheme(): string
63
    {
64
        return $this->scheme;
65
    }
66
67
    /**
68
     * @param string $scheme
69
     * @return ODataCategory
70
     */
71
    public function setScheme(string $scheme): ODataCategory
72
    {
73
        $this->scheme = $scheme;
74
        return $this;
75
    }
76
}
77