Classifier   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 101
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 4
Metric Value
wmc 6
c 4
b 0
f 4
lcom 0
cbo 0
dl 0
loc 101
ccs 17
cts 17
cp 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getId() 0 4 1
A getName() 0 4 1
A getScore() 0 4 1
A getOwner() 0 4 1
A getCreated() 0 4 1
1
<?php
2
3
namespace Bobbyshaw\WatsonVisualRecognition;
4
5
use \DateTime;
6
7
/**
8
 * This class formalises information about a classifier.
9
 *
10
 * @api
11
 * @author Tom Robertshaw <[email protected]>
12
 */
13
class Classifier
14
{
15
    /**
16
     * Classifier ID
17
     * @var string
18
     */
19
    private $id;
20
21
    /**
22
     * Classifier Name
23
     * @var string
24
     */
25
    private $name;
26
27
    /**
28
     * Classification score against image
29
     * @var float
30
     */
31
    private $score;
32
33
    /**
34
     * Classifier Owner/Creator
35
     * @var string
36
     */
37
    private $owner;
38
39
    /**
40
     * Classifier Creation Date
41
     *
42
     * @var \DateTime
43
     */
44
    private $created;
45
46
    /**
47
     * Classifier constructor.
48
     *
49
     * @param string $id
50
     * @param string $name
51
     * @param float|null $score
52
     * @param string|null $owner
53
     * @param DateTime|null $created
54
     */
55 21
    public function __construct($id, $name, $score = null, $owner = null, $created = null)
56
    {
57 21
        $this->id = $id;
58 21
        $this->name = $name;
59 21
        $this->score = $score;
60 21
        $this->owner = $owner;
61 21
        $this->created = $created;
62 21
    }
63
64
    /**
65
     * Get Classifier ID.
66
     *
67
     * @return string
68
     */
69 9
    public function getId()
70
    {
71 9
        return $this->id;
72
    }
73
74
    /**
75
     * Get Classifier name.
76
     *
77
     * @return string
78
     */
79 8
    public function getName()
80
    {
81 8
        return $this->name;
82
    }
83
84
    /**
85
     * Get classification score.
86
     *
87
     * @return float|null
88
     */
89 3
    public function getScore()
90
    {
91 3
        return $this->score;
92
    }
93
94
    /**
95
     * Get Owner
96
     *
97
     * @return null|string
98
     */
99 6
    public function getOwner()
100
    {
101 6
        return $this->owner;
102
    }
103
104
    /**
105
     * Get Creation Date
106
     *
107
     * @return DateTime|null
108
     */
109 6
    public function getCreated()
110
    {
111 6
        return $this->created;
112
    }
113
}
114