Completed
Push — master ( 4a545c...9f7f98 )
by T
01:03
created

Property::getFullyQualifiedName()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 8
Ratio 100 %

Code Coverage

Tests 4
CRAP Score 2.032

Importance

Changes 0
Metric Value
dl 8
loc 8
ccs 4
cts 5
cp 0.8
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 2
crap 2.032
1
<?php
2
3
namespace PHPSemVerChecker\Node\Statement;
4
5
use PhpParser\Node\Stmt;
6
use PhpParser\Node\Stmt\Property as BaseProperty;
7
8 View Code Duplication
class Property
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
	/**
11
	 * @param \PhpParser\Node\Stmt          $context
12
	 * @param \PhpParser\Node\Stmt\Property $property
13
	 * @return string
14
	 */
15 4
	public static function getFullyQualifiedName(Stmt $context, BaseProperty $property)
16
	{
17 4
		$namespace = $context->name;
18 4
		if (isset($context->namespacedName)) {
19
			$namespace = $context->namespacedName->toString();
20
		}
21 4
		return $namespace . '::$' . $property->props[0]->name;
22
	}
23
}
24