Passed
Push — main ( 40d4d0...b1f2dd )
by N.
05:04
created

Oddstabellrad   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 26
dl 0
loc 55
ccs 0
cts 27
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A oddstabellrad() 0 39 1
A __construct() 0 1 1
1
<?php
2
3
/**
4
 * Klass Oddstabellrad.
5
 * @author Niklas Dougherty
6
 */
7
8
declare(strict_types=1);
9
10
namespace Tips\Moduler\TT;
11
12
use Tips\Moduler\TT;
13
14
/**
15
 * Klass Oddstabellrad.
16
 * För topptipset.
17
 */
18
final class Oddstabellrad {
19
	/**
20
	 * Initiera.
21
	 */
22
	public function __construct(protected TT $tt) {
23
	}
24
25
	/**
26
	 * Tabellrad för prediktionsdata.
27
	 * @param string[] $teckenfördelning
28
	 * @param string[] $formaterad_dist
29
	 * @param int[] $tix
30
	 * @param string[] $odds
31
	 * @param string[] $oddsstil
32
	 * @param string[] $streckstil
33
	 */
34
	public function oddstabellrad(
35
		int $index,
36
		string $sorteringsstil,
37
		array $teckenfördelning,
38
		array $formaterad_dist,
39
		string $odds_finns,
40
		array $tix,
41
		array $odds,
42
		array $oddsstil,
43
		array $streckstil
44
	): string {
45
		$matchindex = $index + 1;
46
47
		/**
48
		 * SKicka till TT\Matchtabeller.
49
		 */
50
		return <<< EOT
51
								<tr>
52
									<td class="match höger">$matchindex</td>
53
									<td{$teckenfördelning[0]}>{$formaterad_dist[0]}</td>
54
									<td{$teckenfördelning[1]}>{$formaterad_dist[1]}</td>
55
									<td{$teckenfördelning[2]}>{$formaterad_dist[2]}</td>
56
									<td$sorteringsstil class="vänster">{$this->tt->hemmalag[$index]} – {$this->tt->bortalag[$index]}</td>
57
									<td class="input$odds_finns"><input class="oddskolumn" tabindex="{$tix[3 * $index]}" type="text" name="tt_odds[$index][]" size="2" maxlength="5" value="{$odds[0]}"></td>
58
									<td class="input$odds_finns"><input class="oddskolumn" tabindex="{$tix[3 * $index + 1]}" type="text" name="tt_odds[$index][]" size="2" maxlength="5" value="{$odds[1]}"></td>
59
									<td class="input$odds_finns"><input class="oddskolumn" tabindex="{$tix[3 * $index + 2]}" type="text" name="tt_odds[$index][]" size="2" maxlength="5" value="{$odds[2]}"></td>
60
									{$oddsstil[0]}
61
									{$oddsstil[1]}
62
									{$oddsstil[2]}
63
									<td class="höger">{$this->tt->tt_streck[$index][0]}</td>
64
									<td class="höger">{$this->tt->tt_streck[$index][1]}</td>
65
									<td class="höger">{$this->tt->tt_streck[$index][2]}</td>
66
									{$streckstil[0]}
67
									{$streckstil[1]}
68
									{$streckstil[2]}
69
									<td class="höger">{$this->tt->utfallshistorik[$index][0]}</td>
70
									<td class="höger">{$this->tt->utfallshistorik[$index][1]}</td>
71
									<td class="höger">{$this->tt->utfallshistorik[$index][2]}</td>
72
									<td class="höger vinst10">{$this->tt->utfallshistorik[$index][3]}</td>
73
								</tr>
74
75
EOT;
76
	}
77
}
78