Passed
Push — main ( d29be2...38376b )
by N.
03:16
created

ProvaRad   A

Complexity

Total Complexity 13

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 32
ccs 18
cts 18
cp 1
rs 10
c 0
b 0
f 0
wmc 13

2 Methods

Rating   Name   Duplication   Size   Complexity  
A pröva_intervall() 0 6 6
B pröva_rad() 0 17 7
1
<?php
2
3
/**
4
 * Klass ProvaRad.
5
 * @author Niklas Dougherty
6
 */
7
8
declare(strict_types=1);
9
10
namespace Tips\Moduler\TT\TTGridGenerera;
11
12
use Tips\Moduler\TT;
13
14
/**
15
 * Klass ProvaRad.
16
 */
17
class ProvaRad extends Prova {
18
	/**
19
	 * Pröva TT-rad.
20
	 */
21 1
	protected function pröva_rad(string $tipsrad_012): bool {
22 1
		$ok = true;
23
24 1
		$this->tt->tt_pröva_reduktion and $ok = $this->pröva_reduktion($tipsrad_012);
25 1
		$ok and $this->pröva_intervall($tipsrad_012);
26
27 1
		if ($ok && $this->tt->tt_pröva_spikar) {
28 1
			foreach (array_keys($this->tt->spikar) as $index) {
29 1
				$ok and $ok = $this->pröva_spikar(
30 1
					$this->tt->spikar[$index],
31 1
					$this->tt->andel_spikar[$index],
32 1
					$tipsrad_012
33 1
				);
34
			}
35
		}
36
37 1
		return $ok;
38
	}
39
40
	/**
41
	 * Pröva intervall, delberäkning.
42
	 */
43 1
	private function pröva_intervall(string $tipsrad_012): bool {
44 1
		$ok = true;
45 1
		$this->tt->tt_pröva_täckning and $ok = $this->pröva_täckningskod($tipsrad_012);
46 1
		$ok and $this->tt->tt_pröva_t_intv and $ok = $this->pröva_teckenintervall($tipsrad_012);
47 1
		$ok and $this->tt->tt_pröva_o_intv and $ok = $this->pröva_oddsintervall($tipsrad_012);
48 1
		return $ok;
49
	}
50
}
51