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

ProvaRad::pröva_intervall()   A

Complexity

Conditions 6
Paths 18

Size

Total Lines 6
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 6

Importance

Changes 0
Metric Value
cc 6
eloc 5
nc 18
nop 1
dl 0
loc 6
ccs 6
cts 6
cp 1
crap 6
rs 9.2222
c 0
b 0
f 0
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