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

ReflectionPropertyName   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 9
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 7 2
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