Completed
Push — master ( 952551...2fc2de )
by Gallice
45s
created

AbstractStep   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

4 Methods

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