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.
Completed
Push — master ( 3e29f4...a0257c )
by Gytis
03:40 queued 11s
created

PropTypeSubject::fromElement()   A

Complexity

Conditions 3
Paths 1

Size

Total Lines 15
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 10
nc 1
nop 1
dl 0
loc 15
ccs 11
cts 11
cp 1
crap 3
rs 9.9332
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
use Gskema\TypeSniff\Core\Type\Common\UndefinedType;
8
9
class PropTypeSubject extends AbstractTypeSubject
10
{
11
    /**
12
     * @param AbstractFqcnPropElement $prop
13
     *
14
     * @return static
15
     */
16 4
    public static function fromElement(AbstractFqcnPropElement $prop)
17
    {
18 4
        $docBlock = $prop->getDocBlock();
19
20
        /** @var VarTag|null $varTag */
21 4
        $varTag = $docBlock->getTagsByName('var')[0] ?? null;
22
23 4
        return new static(
24 4
            $varTag ? $varTag->getType() : null,
25 4
            new UndefinedType(),
26 4
            $prop->getDefaultValueType(),
27 4
            $varTag ? $varTag->getLine() : $prop->getLine(),
28 4
            $prop->getLine(),
29 4
            'property $'.$prop->getPropName(),
30 4
            $docBlock
31
        );
32
    }
33
}
34