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   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

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