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   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
dl 0
loc 23
ccs 8
cts 10
cp 0.8
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 6

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 14 3
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
}