AbstractModel::getDescription()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace gossi\codegen\model;
5
6
/**
7
 * Parent of all models
8
 *
9
 * @author Thomas Gossmann
10
 */
11
abstract class AbstractModel {
12
13
	/** @var string */
14
	protected $description;
15
16
	/**
17
	 * Returns this description
18
	 *
19
	 * @return string
20
	 */
21 23
	public function getDescription(): ?string {
22 23
		return $this->description;
23
	}
24
25
	/**
26
	 * Sets the description, which will also be used when generating a docblock
27
	 *
28
	 * @param string|array $description
29
	 * @return $this
30
	 */
31 14
	public function setDescription($description) {
32 14
		if (is_array($description)) {
33 1
			$description = implode("\n", $description);
34
		}
35 14
		$this->description = $description;
36 14
		return $this;
37
	}
38
39
}
40