FinalPart::setFinal()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace gossi\codegen\model\parts;
5
6
/**
7
 * Abstract Part
8
 *
9
 * Keeps track if the model has a final modifier or not
10
 *
11
 * @author Thomas Gossmann
12
 */
13
trait FinalPart {
14
15
	/** @var bool */
16
	private $final = false;
17
18
	/**
19
	 * Returns whether this is final
20
	 *
21
	 * @return bool `true` for final and `false` if not
22
	 */
23 23
	public function isFinal(): bool {
24 23
		return $this->final;
25
	}
26
27
	/**
28
	 * Sets this final
29
	 *
30
	 * @param bool $final `true` for final and `false` if not
31
	 * @return $this
32
	 */
33 17
	public function setFinal(bool $final) {
34 17
		$this->final = $final;
35
36 17
		return $this;
37
	}
38
}
39