Passed
Push — main ( e5e48e...78d8c3 )
by N.
05:08
created

Prova::annonsera()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 3
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
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 1
	public function pröva_tipsrad(string $tipsrad_012): bool {
20 1
		[$x, $y] = $this->graf->tipsgrafskoordinater($tipsrad_012);
21 1
		foreach ($this->rektanglar as [$x1, $y1, $x2, $y2]) {
22 1
			if (in($x, $x1, $x2) && in($y, $y1, $y2)) {
23 1
				return true;
24
			}
25
		}
26
27 1
		return $this->tick();
28
	}
29
30
	/**
31
	 * Annonsera modul.
32
	 */
33 1
	public function annonsera(): string {
34 1
		return "r={$this->min_radie}, n={$this->min_antal} " .
35 1
			$this->attraktionsfaktor($this->attraktionsfaktor, 'kluster_attraktionsfaktor');
36
	}
37
38
	/**
39
	 * Visa kommentar.
40
	 */
41
	public function kommentar(): string {
42
		return self::class . " r={$this->min_radie}, n={$this->min_antal} | a={$this->attraktionsfaktor}";
43
	}
44
}
45