Completed
Pull Request — master (#30)
by
unknown
05:11
created

PhpInterfaceVisitor::visitInterface()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2.0185

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
ccs 5
cts 6
cp 0.8333
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
crap 2.0185
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