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

Vinstspridning::visa_vinstspridning()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 3.0175

Importance

Changes 0
Metric Value
cc 3
eloc 7
nc 3
nop 0
dl 0
loc 12
ccs 7
cts 8
cp 0.875
crap 3.0175
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Klass Vinstspridning.
5
 * @author Niklas Dougherty
6
 */
7
8
declare(strict_types=1);
9
10
namespace Tips\Klasser;
11
12
use Tips\Klasser\Vinstspridning\Rita;
13
14
/**
15
 * Klass Vinstspridning.
16
 */
17
final class Vinstspridning extends Rita {
18
	/**
19
	 * Visa vinstspridning.
20
	 */
21 2
	public function visa_vinstspridning(): string {
22 2
		if ($this->tipsrad_012 === '') {
23
			return '';
24
		}
25
26 2
		$this->graf = new Graf();
27 2
		$this->bildfil = VINSTSPRIDNING . "/{$this->tipsrad_012}.png";
28 2
		if (!file_exists(GRAF . $this->bildfil)) {
29 1
			$this->rita();
30
		}
31
32 2
		return $this->graf->rendera_tipsgraf($this->bildfil);
33
	}
34
}
35