Completed
Push — master ( 26109a...6e7ebd )
by T
02:01
created

Property::getFullyQualifiedName()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 3
Ratio 37.5 %

Code Coverage

Tests 4
CRAP Score 2.1481

Importance

Changes 0
Metric Value
dl 3
loc 8
ccs 4
cts 6
cp 0.6667
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 2
crap 2.1481
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;
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...
18 4
		if (isset($context->namespacedName)) {
19
			$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...
20
		}
21 4
		return $namespace . '::$' . $property->props[0]->name;
22
	}
23
}
24