GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

PropTypeSubject   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
dl 0
loc 24
ccs 12
cts 12
cp 1
rs 10
c 1
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromElement() 0 17 3
1
<?php
2
3
namespace Gskema\TypeSniff\Inspection\Subject;
4
5
use Gskema\TypeSniff\Core\CodeElement\Element\AbstractFqcnPropElement;
6
use Gskema\TypeSniff\Core\DocBlock\Tag\VarTag;
7
8
class PropTypeSubject extends AbstractTypeSubject
9
{
10
    /**
11
     * @param AbstractFqcnPropElement $prop
12
     *
13
     * @return static
14
     */
15 12
    public static function fromElement(AbstractFqcnPropElement $prop)
16
    {
17 12
        $docBlock = $prop->getDocBlock();
18
19
        /** @var VarTag|null $varTag */
20 12
        $varTag = $docBlock->getTagsByName('var')[0] ?? null;
21
22 12
        return new static(
23 12
            $varTag ? $varTag->getType() : null,
24 12
            $prop->getType(),
25 12
            $prop->getDefaultValueType(),
26 12
            $varTag ? $varTag->getLine() : $prop->getLine(),
27 12
            $prop->getLine(),
28 12
            'property $' . $prop->getPropName(),
29
            $docBlock,
30 12
            $prop->getAttributeNames(),
31 12
            $prop->getFqcn() . '::' . $prop->getPropName()
32
        );
33
    }
34
}
35