Completed
Pull Request — master (#8)
by
unknown
05:09
created

Action   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 5
c 2
b 0
f 1
lcom 0
cbo 0
dl 0
loc 59
ccs 10
cts 10
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getAction() 0 4 1
A getConfidence() 0 4 1
A getType() 0 4 1
A getEntities() 0 3 1
1
<?php
2
3
namespace Tgallice\Wit\Model\Step;
4
5
use Tgallice\Wit\Model\Step;
6
7
class Action implements Step
8
{
9
    /**
10
     * @var string
11
     */
12
    private $action;
13
14
    /**
15
     * @var float
16
     */
17
    private $confidence;
18
19
    /**
20
     * @var array
21
     */
22
    private $entities;
23 8
24
    /**
25 8
     * @param string $action
26 8
     * @param float $confidence
27 8
     */
28
    public function __construct($action, $confidence, $entities)
29
    {
30
        $this->action = $action;
31
        $this->confidence = (float) $confidence;
32 2
        $this->entities = $entities;
33
    }
34 2
35
    /**
36
     * @return string
37
     */
38
    public function getAction()
39
    {
40 1
        return $this->action;
41
    }
42 1
43
    /**
44
     * @return float
45
     */
46
    public function getConfidence()
47
    {
48 1
        return $this->confidence;
49
    }
50 1
51
    /**
52
     * @return string
53
     */
54
    public function getType()
55
    {
56
        return Step::TYPE_ACTION;
57
    }
58
59
    /**
60
     * @return array
61
     */
62
    public function getEntities() {
63
        return $this->entities;
64
    }
65
}
66