PropertyParserVisitor::visitProperty()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 9
cts 9
cp 1
rs 9.8666
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\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