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

Prova::kommentar()   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 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