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 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 7

Test Coverage

Coverage 70.59%

Importance

Changes 0
Metric Value
dl 0
loc 33
ccs 12
cts 17
cp 0.7059
rs 10
c 0
b 0
f 0
wmc 5
lcom 0
cbo 7

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 24 5
1
<?php
2
3
namespace PhpBoot\Entity\Annotations;
4
5
use PhpBoot\Annotation\AnnotationBlock;
6
use PhpBoot\Annotation\AnnotationTag;
7
use PhpBoot\Entity\ContainerFactory;
8
use PhpBoot\Entity\EntityContainer;
9
use PhpBoot\Entity\EntityContainerBuilder;
10
use PhpBoot\Entity\MixedTypeContainer;
11
use PhpBoot\Exceptions\AnnotationSyntaxException;
12
use PhpBoot\Utils\AnnotationParams;
13
use PhpBoot\Utils\TypeHint;
14
15
class VarAnnotationHandler
16
{
17
    /**
18
     * @param EntityContainer $container
19
     * @param AnnotationBlock|AnnotationTag $ann
20
     * @param EntityContainerBuilder $builder
21
     * @return void
22
     */
23 7
    public function __invoke(EntityContainer $container, $ann, EntityContainerBuilder $builder)
24
    {
25 7
        $params = new AnnotationParams($ann->description, 3);
26 7
        if($params->count()){
27 7
            $type = $params->getParam(0);
28
            //TODO 校验type类型
29 7
            $target = $ann->parent->name;
30 7
            $property = $container->getProperty($target);
31 7
            $property or \PhpBoot\abort($container->getClassName()." property $target not exist ");
32 7
            if($type == null || $type == 'mixed'){
33
                $property->container = new MixedTypeContainer();
34
            } else{
35
                // TODO 判断$type是否匹配
36 7
                $property->type = TypeHint::normalize($type, $container->getClassName());
37
                // TODO 防止递归死循环
38 7
                $property->container = ContainerFactory::create($builder, $property->type);
39
            }
40 7
        }else{
41
            \PhpBoot\abort(new AnnotationSyntaxException(
42
                "The annotation \"@{$ann->name} {$ann->description}\" of {$container->getClassName()}::{$ann->parent->name} require 1 param, 0 given"
43
            ));
44
        }
45
46
    }
47
}