Passed
Push — main ( a92fbe...d29be2 )
by N.
05:41 queued 01:24
created

Prova   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 90.91%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 28
ccs 10
cts 11
cp 0.9091
rs 10
c 0
b 0
f 0
wmc 6

3 Methods

Rating   Name   Duplication   Size   Complexity  
A annonsera() 0 3 1
A kommentar() 0 2 1
A pröva_tipsrad() 0 9 4
1
<?php
2
3
/**
4
 * Klass Prova.
5
 * @author Niklas Dougherty
6
 */
7
8
declare(strict_types=1);
9
10
namespace Tips\Moduler\Kluster;
11
12
/**
13
 * Klass Prova.
14
 */
15
class Prova extends Preferenser {
16
	/**
17
	 * Pröva tipsrad.
18
	 */
19 2
	public function pröva_tipsrad(string $tipsrad_012): bool {
20 2
		[$x, $y] = $this->graf->tipsgrafskoordinater($tipsrad_012);
21 2
		foreach ($this->rektanglar as [$x1, $y1, $x2, $y2]) {
22 2
			if (in($x, $x1, $x2) && in($y, $y1, $y2)) {
23 2
				return true;
24
			}
25
		}
26
27
		return $this->tick();
28
	}
29
30
	/**
31
	 * Annonsera modul.
32
	 */
33 2
	public function annonsera(): string {
34 2
		return "r={$this->min_radie}, n={$this->min_antal} " .
35 2
			$this->attraktionsfaktor($this->attraktionsfaktor, 'kluster_attraktionsfaktor');
36
	}
37
38
	/**
39
	 * Visa kommentar.
40
	 */
41 1
	public function kommentar(): string {
42 1
		return self::class . " r={$this->min_radie}, n={$this->min_antal} | a={$this->attraktionsfaktor}";
43
	}
44
}
45