Completed
Pull Request — master (#30)
by
unknown
03:52
created

PhpInterfaceVisitor::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 3
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
namespace gossi\codegen\parser\visitor;
3
4
use gossi\codegen\model\PhpInterface;
5
use PhpParser\Node\Stmt\Interface_;
6
7
class PhpInterfaceVisitor extends AbstractPhpStructVisitor {
8
9 1
	public function __construct() {
10 1
		parent::__construct(new PhpInterface());
11 1
	}
12
13
	/**
14
	 * @return PhpInterface
15
	 */
16 1
	public function getInterface() {
17 1
		return $this->struct;
18
	}
19
20 1
	protected function visitInterface(Interface_ $node) {
21 1
		$struct = $this->getInterface();
22
23 1
		foreach ($node->extends as $name) {
24
			$struct->addInterface(implode('\\', $name->parts));
25 1
		}
26 1
	}
27
}
28