Passed
Push — main ( e5ef3a...f1ef56 )
by N.
04:15
created

AndelAjax::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Klass AndelAjax.
5
 * @author Niklas Dougherty
6
 */
7
8
declare(strict_types=1);
9
10
namespace Tips\Moduler\Ajax;
11
12
use Tips\Klasser\Preludium;
13
use Tips\Egenskaper\Ajax;
14
15
/**
16
 * Ajaxanrop ligger utanför ordinarie ordning.
17
 */
18 1
require_once dirname(__FILE__) . '/../../../vendor/autoload.php';
19 1
new Preludium();
20
21
/**
22
 * Klass AndelAjax.
23
 * @SuppressWarnings("PHPMD.UnusedPrivateMethod")
24
 */
25
final class AndelAjax {
26
	use Ajax;
0 ignored issues
show
Bug introduced by
The trait Tips\Egenskaper\Ajax requires the property $logg which is not provided by Tips\Moduler\Ajax\AndelAjax.
Loading history...
27
28 3
	public function __construct() {
29 3
		$this->förgrena();
30
	}
31
32
	/**
33
	 * Håll andel ettor inom godtagbara intervall.
34
	 */
35 1
	private function andel_1_min(): void {
0 ignored issues
show
Unused Code introduced by
The method andel_1_min() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
36 1
		$andel_1_min = $this->db_preferenser->validera_indata('andel_1_min', 0, 13, 3, 'andel.andel_1_min');
37 1
		$andel_1_max = $this->db_preferenser->validera_indata('andel_1_max', 0, 13, 8, 'andel.andel_1_max');
38 1
		$this->db_preferenser->komparera_preferenser($andel_1_min, $andel_1_max, 3, 8, 'andel.andel_1_min', 'andel.andel_1_max');
39
	}
40
41
	/**
42
	 * Håll andel kryss inom godtagbara intervall.
43
	 */
44 1
	private function andel_x_min(): void {
0 ignored issues
show
Unused Code introduced by
The method andel_x_min() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
45 1
		$andel_x_min = $this->db_preferenser->validera_indata('andel_x_min', 0, 13, 1, 'andel.andel_x_min');
46 1
		$andel_x_max = $this->db_preferenser->validera_indata('andel_x_max', 0, 13, 6, 'andel.andel_x_max');
47 1
		$this->db_preferenser->komparera_preferenser($andel_x_min, $andel_x_max, 1, 6, 'andel.andel_x_min', 'andel.andel_x_max');
48
	}
49
50
	/**
51
	 * Håll andel tvåor inom godtagbara intervall.
52
	 */
53 1
	private function andel_2_min(): void {
0 ignored issues
show
Unused Code introduced by
The method andel_2_min() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
54 1
		$andel_2_min = $this->db_preferenser->validera_indata('andel_2_min', 0, 13, 2, 'andel.andel_2_min');
55 1
		$andel_2_max = $this->db_preferenser->validera_indata('andel_2_max', 0, 13, 7, 'andel.andel_2_max');
56 1
		$this->db_preferenser->komparera_preferenser($andel_2_min, $andel_2_max, 2, 7, 'andel.andel_2_min', 'andel.andel_2_max');
57
	}
58
59
	/**
60
	 * Spara attraktionsfaktor.
61
	 */
62 1
	private function attraktionsfaktor(): void {
0 ignored issues
show
Unused Code introduced by
The method attraktionsfaktor() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
63 1
		$this->ändra_attraktionsfaktor('andel');
64
	}
65
}
66
67
new AndelAjax();
68