Completed
Push — master ( 0e1c32...e580ff )
by T
05:02
created

Property::getFullyQualifiedName()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 8
Ratio 100 %

Code Coverage

Tests 4
CRAP Score 2.032

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 8
loc 8
ccs 4
cts 5
cp 0.8
rs 9.4285
cc 2
eloc 5
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 4
	public static function getFullyQualifiedName(Stmt $context, BaseProperty $property)
10
	{
11 4
		$namespace = $context->name;
0 ignored issues
show
Bug introduced by
The property name does not seem to exist in PhpParser\Node\Stmt.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
12 4
		if (isset($context->namespacedName)) {
13
			$namespace = $context->namespacedName->toString();
0 ignored issues
show
Bug introduced by
The property namespacedName does not seem to exist in PhpParser\Node\Stmt.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
14
		}
15 4
		return $namespace . '::$' . $property->props[0]->name;
16
	}
17
}
18