1 | <?php |
||
5 | class Result |
||
6 | { |
||
7 | /** |
||
8 | * @var array |
||
9 | */ |
||
10 | private $assumptions = []; |
||
11 | |||
12 | /** |
||
13 | * @var int |
||
14 | */ |
||
15 | private $boolExpressionsCount = 0; |
||
16 | |||
17 | /** |
||
18 | * @param string $file |
||
19 | * @param int $line |
||
20 | * @param string $message |
||
21 | */ |
||
22 | 6 | public function addAssumption($file, $line, $message) |
|
30 | |||
31 | 6 | public function increaseBoolExpressionsCount() |
|
35 | |||
36 | /** |
||
37 | * @return array |
||
38 | */ |
||
39 | 5 | public function getAssumptions() |
|
43 | |||
44 | /** |
||
45 | * @return int |
||
46 | */ |
||
47 | 6 | public function getAssumptionsCount() |
|
51 | |||
52 | /** |
||
53 | * @return float |
||
54 | */ |
||
55 | 6 | public function getPercentage() |
|
56 | { |
||
57 | 6 | if ($this->getBoolExpressionsCount() === 0) { |
|
58 | 2 | return 0; |
|
59 | } |
||
60 | |||
61 | 4 | return round($this->getAssumptionsCount() / $this->getBoolExpressionsCount() * 100); |
|
62 | } |
||
63 | |||
64 | /** |
||
65 | * @return int |
||
66 | */ |
||
67 | 7 | public function getBoolExpressionsCount() |
|
71 | } |
||
72 |