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.

VarAnnotationHandler::__invoke()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 3.072

Importance

Changes 0
Metric Value
cc 3
nc 4
nop 2
dl 0
loc 14
ccs 8
cts 10
cp 0.8
crap 3.072
rs 9.7998
c 0
b 0
f 0
1
<?php
2
namespace PhpBoot\DI\Annotations;
3
4
use DI\Definition\EntryReference;
5
use DI\Definition\ObjectDefinition\PropertyInjection;
6
use PhpBoot\Annotation\AnnotationBlock;
7
use PhpBoot\Annotation\AnnotationHandler;
8
use PhpBoot\Annotation\AnnotationTag;
9
use PhpBoot\DI\ObjectDefinitionContext;
10
use PhpBoot\Exceptions\AnnotationSyntaxException;
11
use PhpBoot\Utils\AnnotationParams;
12
use PhpBoot\Utils\Logger;
13
use PhpBoot\Utils\TypeHint;
14
15
class VarAnnotationHandler
16
{
17
18
    /**
19
     * @param ObjectDefinitionContext $context
20
     * @param AnnotationBlock|AnnotationTag $ann
21
     * @return void
22
     */
23 16
    public function __invoke(ObjectDefinitionContext $context, $ann)
24
    {
25 16
        $className = $context->definition->getClassName();
26 16
        if(!$ann->parent){
27
            Logger::debug("The annotation \"@{$ann->name} {$ann->description}\" of $className should be used with parent");
28
        }
29 16
        $target = $ann->parent->name;
30
        //
31 16
        $params = new AnnotationParams($ann->description, 2);
32
33 16
        count($params)>0 or \PhpBoot\abort(new AnnotationSyntaxException("The annotation \"@{$ann->name} {$ann->description}\" of $className::$target require at least one param, 0 given"));
34
35 16
        $context->vars[$target] = TypeHint::normalize($params[0], $className);
36
    }
37
}