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

Tips   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 53.33%

Importance

Changes 0
Metric Value
eloc 21
dl 0
loc 32
ccs 8
cts 15
cp 0.5333
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A spara_tips() 0 7 1
A __construct() 0 8 1
1
<?php
2
3
/**
4
 * Klass Tips.
5
 * @author Niklas Dougherty
6
 */
7
8
declare(strict_types=1);
9
10
namespace Tips\Klasser;
11
12
/**
13
 * Klass Tips.
14
 */
15
final class Tips {
16
	public Utdelning $utdelning;
17
	public Matcher $matcher;
18
	public Prediktioner $odds;
19
	public Prediktioner $streck;
20
	public Parallellisering $parallellisering;
21
	public Spelade $spelade;
22
	public Moduler $moduler;
23
24
	/**
25
	 * Instantiera en rad klasser.
26
	 */
27 4
	public function __construct(public Spel $spel) {
28 4
		$this->utdelning = new Utdelning($this->spel);
29 4
		$this->matcher = new Matcher($this->spel);
30 4
		$this->odds = new Prediktioner($this->spel, 'odds');
31 4
		$this->streck = new Prediktioner($this->spel, 'streck');
32 4
		$this->parallellisering = new Parallellisering($this->spel);
33 4
		$this->spelade = new Spelade($this->utdelning, $this->matcher);
34 4
		$this->moduler = new Moduler($this->utdelning, $this->odds, $this->streck, $this->matcher);
35
	}
36
37
	/**
38
	 * Spara tipsdata.
39
	 */
40
	public function spara_tips(): void {
41
		$this->utdelning->spara_utdelning();
42
		$this->matcher->spara_matcher();
43
		$this->odds->spara_prediktioner();
44
		$this->streck->spara_prediktioner();
45
		$this->odds->justerade_pred->spara_historik();
46
		$this->spel->db->logg->logga(self::class . ": ✅ Sparade tips. ({$this->spel->omgång})");
47
	}
48
}
49