Completed
Push — develop ( bc21b0...0bdfd4 )
by Adam
24:26 queued 09:29
created

Classification::getClass()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace IBM\Watson\VisualRecognition\Model\Classifier;
4
5
use IBM\Watson\Common\Model\ApiResponseInterface;
6
7
class Classification implements ApiResponseInterface
8
{
9
    /**
10
     * @var string
11
     */
12
    private $class;
13
14
    /**
15
     * @var float
16
     */
17
    private $score;
18
19
    /**
20
     * Classification constructor.
21
     *
22
     * @param $class
23
     * @param $score
24
     */
25
    public function __construct($class, $score)
26
    {
27
        $this->class = $class;
28
        $this->score = $score;
29
    }
30
31
    /**
32
     * Create Classification
33
     *
34
     * @param array $data
35
     *
36
     * @return \IBM\Watson\VisualRecognition\Model\Classifier\Classification
37
     */
38
    public static function create(array $data)
39
    {
40
        return new self($data['class'], $data['score']);
41
    }
42
43
    /**
44
     * @return mixed
45
     */
46
    public function getClass()
47
    {
48
        return $this->class;
49
    }
50
51
    /**
52
     * @return float
53
     */
54
    public function getScore()
55
    {
56
        return $this->score;
57
    }
58
}
59