PropertyParserVisitor   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 7

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A visitProperty() 0 12 1
1
<?php
2
declare(strict_types=1);
3
4
namespace gossi\codegen\parser\visitor;
5
6
use gossi\codegen\model\PhpProperty;
7
use gossi\codegen\parser\visitor\parts\MemberParserPart;
8
use gossi\codegen\parser\visitor\parts\ValueParserPart;
9
use PhpParser\Node\Stmt\Property;
10
11
class PropertyParserVisitor extends StructParserVisitor {
12
13
	use ValueParserPart;
14
	use MemberParserPart;
15
16 5
	public function visitProperty(Property $node) {
17 5
		$prop = $node->props[0];
18
19 5
		$p = new PhpProperty($prop->name->name);
20 5
		$p->setStatic($node->isStatic());
21 5
		$p->setVisibility($this->getVisibility($node));
22
23 5
		$this->parseValue($p, $prop);
24 5
		$this->parseMemberDocblock($p, $node->getDocComment());
25
26 5
		$this->struct->setProperty($p);
27 5
	}
28
29
}
30