Passed
Push — main ( 1bd9df...40d4d0 )
by N.
03:49
created

Oddstabellrad   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 24
dl 0
loc 44
ccs 25
cts 25
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A oddstabellrad() 0 27 1
A __construct() 0 5 1
1
<?php
2
3
/**
4
 * Klass Oddstabellrad.
5
 * @author Niklas Dougherty
6
 */
7
8
declare(strict_types=1);
9
10
namespace Tips\Moduler\System;
11
12
use Tips\Klasser\Prediktioner;
13
use Tips\Klasser\Matcher;
14
15
/**
16
 * Klass Oddstabellrad.
17
 * Undre tabell med matcher, odds, streck och historik.
18
 */
19
final class Oddstabellrad {
20
	/**
21
	 * Initiera.
22
	 */
23 1
	public function __construct(
24
		protected Prediktioner $odds,
25
		protected Prediktioner $streck,
26
		protected Matcher $matcher
27
	) {
28 1
	}
29
30
	/**
31
	 * Tabellrad för prediktionsdata.
32
	 * @param string[] $o_stil
33
	 * @param string[] $s_stil
34
	 * @param array<int, string[]> $odds
35
	 */
36 1
	public function oddstabellrad(int $index, array $o_stil, array $odds, array $s_stil): string {
37 1
		$matchindex = $index + 1;
38
39
		/**
40
		 * SKicka till Matchtabeller.
41
		 */
42 1
		return <<< EOT
43 1
							<tr>
44 1
								<td class="match höger ix2">$matchindex</td>
45 1
								<td{$this->odds->sorteringsstil[$index]} class="vänster">{$this->matcher->match[$index]}</td>
46 1
								<td class="mindre">{$this->matcher->resultat[$index]}</td>
47 1
								<td{$o_stil[0]}>{$odds[$index][0]}</td>
48 1
								<td{$o_stil[1]}>{$odds[$index][1]}</td>
49 1
								<td{$o_stil[2]}>{$odds[$index][2]}</td>
50 1
								{$this->odds->stil_sannolikheter[$index][0]}
51 1
								{$this->odds->stil_sannolikheter[$index][1]}
52 1
								{$this->odds->stil_sannolikheter[$index][2]}
53 1
								<td{$s_stil[0]}>{$this->streck->prediktioner[$index][0]}</td>
54 1
								<td{$s_stil[1]}>{$this->streck->prediktioner[$index][1]}</td>
55 1
								<td{$s_stil[2]}>{$this->streck->prediktioner[$index][2]}</td>
56 1
								{$this->streck->stil_sannolikheter[$index][0]}
57 1
								{$this->streck->stil_sannolikheter[$index][1]}
58 1
								{$this->streck->stil_sannolikheter[$index][2]}
59 1
								<td class="höger">{$this->odds->utfallshistorik->utfallshistorik[$index][0]}</td>
60 1
								<td class="höger">{$this->odds->utfallshistorik->utfallshistorik[$index][1]}</td>
61 1
								<td class="höger">{$this->odds->utfallshistorik->utfallshistorik[$index][2]}</td>
62 1
								<td class="höger vinst10">{$this->odds->utfallshistorik->utfallshistorik[$index][3]}</td>
63
							</tr>
64
65 1
EOT;
66
	}
67
}
68