Passed
Push — main ( f1b4ad...6ccac6 )
by N.
04:46
created

Tipsrader   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 44.44%

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 21
ccs 4
cts 9
cp 0.4444
rs 10
c 0
b 0
f 0
wmc 5

1 Method

Rating   Name   Duplication   Size   Complexity  
A hämta_tipsrader() 0 13 5
1
<?php
2
3
/**
4
 * Klass Tipsrader.
5
 * @author Niklas Dougherty
6
 */
7
8
declare(strict_types=1);
9
10
namespace Tips\Moduler\Vinstgraf;
11
12
/**
13
 * Klass Tipsrader.
14
 */
15
class Tipsrader extends Rita {
16
	public int $antal_rader = 0;
17
	public int $totalt_antal_rader = 0;
18
	/** @var array<int, string[]> $tipsrader */ protected array $tipsrader = [];
19
20
	/**
21
	 * Hämta tipsrader.
22
	 */
23 1
	protected function hämta_tipsrader(): void {
24 1
		$u13 = $this->utdelning->utdelningsdata();
25
26 1
		foreach ($this->odds->tipsdata() as $omgång => $tipsrad_012) {
27 1
			if (isset($u13[$omgång])) {
28
				$this->totalt_antal_rader++;
29
30
				if ($u13[$omgång] === 0) {
31
					$u13[$omgång] = MAXVINST;
32
				}
33
34
				if (in($u13[$omgång], $this->utdelning_13_min, $this->utdelning_13_max)) {
35
					$this->tipsrader[] = [$tipsrad_012, strval($u13[$omgång])];
36
				}
37
			}
38
		}
39
	}
40
}
41