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

FqcnPropSniff::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 1
dl 0
loc 2
ccs 1
cts 1
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Gskema\TypeSniff\Sniffs\CodeElement;
4
5
use Gskema\TypeSniff\Inspection\DocTypeInspector;
6
use Gskema\TypeSniff\Inspection\Subject\PropTypeSubject;
7
use PHP_CodeSniffer\Files\File;
8
use Gskema\TypeSniff\Core\CodeElement\Element\AbstractFqcnPropElement;
9
use Gskema\TypeSniff\Core\CodeElement\Element\ClassPropElement;
10
use Gskema\TypeSniff\Core\CodeElement\Element\CodeElementInterface;
11
use Gskema\TypeSniff\Core\CodeElement\Element\TraitPropElement;
12
13
class FqcnPropSniff implements CodeElementSniffInterface
14
{
15
    protected const CODE = 'FqcnPropSniff';
16
17
    /**
18
     * @inheritDoc
19
     */
20 6
    public function configure(array $config): void
21
    {
22
        // nothing to do
23 6
    }
24
25
    /**
26
     * @inheritDoc
27
     */
28 6
    public function register(): array
29
    {
30
        return [
31 6
            ClassPropElement::class,
32
            TraitPropElement::class,
33
        ];
34
    }
35
36
    /**
37
     * @inheritDoc
38
     * @param AbstractFqcnPropElement $prop
39
     */
40 4
    public function process(File $file, CodeElementInterface $prop): void
41
    {
42 4
        $subject = PropTypeSubject::fromElement($prop);
43
44 4
        DocTypeInspector::reportMandatoryTypes($subject);
45 4
        DocTypeInspector::reportReplaceableTypes($subject);
46 4
        DocTypeInspector::reportRemovableTypes($subject);
47 4
        DocTypeInspector::reportMissingOrWrongTypes($subject);
48
49 4
        static::reportInvalidDescription($subject);
50
51 4
        $subject->writeWarningsTo($file, static::CODE);
52 4
    }
53
54 4
    protected static function reportInvalidDescription(PropTypeSubject $subject): void
55
    {
56 4
        $varTag = $subject->getDocBlock()->getTagsByName('var')[0] ?? null;
57
58 4
        if ($varTag && null !== $varTag->getParamName()) {
59 1
            $subject->addDocTypeWarning('Remove property name $'.$varTag->getParamName().' from @var tag');
60
        }
61 4
    }
62
}
63