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::fromElement()   A
last analyzed

Complexity

Conditions 3
Paths 1

Size

Total Lines 17
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 12
nc 1
nop 1
dl 0
loc 17
ccs 12
cts 12
cp 1
crap 3
rs 9.8666
c 1
b 0
f 0
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