Passed
Pull Request — master (#50)
by Marco
02:46
created

ReflectionPropertyName::__invoke()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Roave\BackwardCompatibility\Formatter;
6
7
use Roave\BetterReflection\Reflection\ReflectionProperty;
8
9
final class ReflectionPropertyName
10
{
11
    public function __invoke(ReflectionProperty $property) : string
12
    {
13
        if ($property->isStatic()) {
14
            return $property->getDeclaringClass()->getName() . '::$' . $property->getName();
15
        }
16
17
        return $property->getDeclaringClass()->getName() . '#$' . $property->getName();
18
    }
19
}
20