PropertyBuilder   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 14 3
1
<?php
2
declare(strict_types=1);
3
4
namespace gossi\codegen\generator\builder;
5
6
use gossi\codegen\generator\builder\parts\ValueBuilderPart;
7
use gossi\codegen\model\AbstractModel;
8
9
class PropertyBuilder extends AbstractBuilder {
10
11
	use ValueBuilderPart;
12
13 8
	public function build(AbstractModel $model): void {
14 8
		$this->buildDocblock($model);
15
16 8
		$this->writer->write($model->getVisibility() . ' ');
17 8
		$this->writer->write($model->isStatic() ? 'static ' : '');
18 8
		$this->writer->write('$' . $model->getName());
19
20 8
		if ($model->hasValue()) {
21 3
			$this->writer->write(' = ');
22 3
			$this->writeValue($model);
23
		}
24
25 8
		$this->writer->writeln(';');
26 8
	}
27
28
}
29