Passed
Push — master ( 6b2979...464731 )
by Alex
04:00 queued 11s
created

ODataCategory   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setScheme() 0 4 1
A getScheme() 0 3 1
A setTerm() 0 4 1
A getTerm() 0 3 1
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
     * @return string
42
     */
43
    public function getTerm(): string
44
    {
45
        return $this->term;
46
    }
47
48
    /**
49
     * @param  string        $term
50
     * @return ODataCategory
51
     */
52
    public function setTerm(string $term): ODataCategory
53
    {
54
        $this->term = $term;
55
        return $this;
56
    }
57
58
    /**
59
     * @return string
60
     */
61
    public function getScheme(): string
62
    {
63
        return $this->scheme;
64
    }
65
66
    /**
67
     * @param  string        $scheme
68
     * @return ODataCategory
69
     */
70
    public function setScheme(string $scheme): ODataCategory
71
    {
72
        $this->scheme = $scheme;
73
        return $this;
74
    }
75
}
76