AbstractModel   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 0
dl 0
loc 29
ccs 7
cts 7
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDescription() 0 3 1
A setDescription() 0 7 2
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