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

Preferenser::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 4
dl 0
loc 6
ccs 0
cts 1
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Klass Preferenser.
5
 * @author Niklas Dougherty
6
 */
7
8
declare(strict_types=1);
9
10
namespace Tips\Moduler\HG;
11
12
use Tips\Klasser\Utdelning;
13
use Tips\Klasser\Prediktioner;
14
use Tips\Klasser\Matcher;
15
use Tips\Klasser\DBPreferenser;
16
use Tips\Egenskaper\Tick;
17
use Tips\Moduler\HG\Konstanter;
0 ignored issues
show
Bug introduced by
The type Tips\Moduler\HG\Konstanter was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
18
19
/**
20
 * Klass Preferenser.
21
 */
22
class Preferenser {
23
	use Tick;
24
	use Konstanter;
25
26
	public DBPreferenser $db_preferenser;
27
	public int $hg_min = self::HG_MIN;
28
	/**
29
	 * @var string[] $utdata
30
	 */
31
	public array $utdata = [];
32
33
	public function __construct(
34
		protected Utdelning $utdelning,
35
		protected Prediktioner $odds,
36
		protected Prediktioner $streck,
37
		protected Matcher $matcher
38
	) {
39
	}
40
41
	/**
42
	 * Uppdatera preferenser.
43
	 */
44
	protected function uppdatera_preferenser(): void {
45
		$this->db_preferenser->int_preferens_i_intervall(
46
			$this->attraktionsfaktor,
47
			AF_MIN,
0 ignored issues
show
Bug introduced by
The constant Tips\Moduler\HG\AF_MIN was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
48
			AF_MAX,
0 ignored issues
show
Bug introduced by
The constant Tips\Moduler\HG\AF_MAX was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
49
			AF_STD,
0 ignored issues
show
Bug introduced by
The constant Tips\Moduler\HG\AF_STD was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
50
			'hg.attraktionsfaktor'
51
		);
52
53
		$this->db_preferenser->int_preferens_i_intervall(
54
			$this->hg_min,
55
			self::HG_MIN,
56
			self::HG_MAX,
57
			self::HG_STD,
58
			'hg.hg_min'
59
		);
60
61
		$this->db_preferenser->hämta_preferens('hg.hg_min');
62
	}
63
}
64