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

Classification   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 52
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A create() 0 4 1
A getClass() 0 4 1
A getScore() 0 4 1
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