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.

ThrowsAnnotationHandler   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Test Coverage

Coverage 84.62%

Importance

Changes 0
Metric Value
dl 0
loc 28
ccs 11
cts 13
cp 0.8462
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 6

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 20 4
1
<?php
2
3
namespace PhpBoot\Controller\Annotations;
4
5
use PhpBoot\Annotation\AnnotationBlock;
6
use PhpBoot\Annotation\AnnotationTag;
7
use PhpBoot\Controller\ControllerContainer;
8
use PhpBoot\Exceptions\AnnotationSyntaxException;
9
use PhpBoot\Utils\AnnotationParams;
10
use PhpBoot\Utils\Logger;
11
use PhpBoot\Utils\TypeHint;
12
13
class ThrowsAnnotationHandler
14
{
15
16
    /**
17
     * @param ControllerContainer $container
18
     * @param AnnotationBlock|AnnotationTag $ann
19
     */
20 3
    public function __invoke(ControllerContainer $container, $ann)
21
    {
22 3
        if(!$ann->parent){
23
            //Logger::debug("The annotation \"@{$ann->name} {$ann->description}\" of {$container->getClassName()} should be used with parent route");
24
            return;
25
        }
26 3
        $target = $ann->parent->name;
27 3
        $route = $container->getRoute($target);
28 3
        if(!$route){
29
            //Logger::debug("The annotation \"@{$ann->name} {$ann->description}\" of {$container->getClassName()}::$target should be used with parent route");
30
            return ;
31
        }
32 3
        $params = new AnnotationParams($ann->description, 2);
33 3
        count($params)>0 or \PhpBoot\abort(new AnnotationSyntaxException("The annotation \"@{$ann->name} {$ann->description}\" of {$container->getClassName()}::$target require at least one param, {$params->count()} given"));
34
35 3
        $type = TypeHint::normalize($params[0], $container->getClassName()); // TODO 缺少类型时忽略错误
36 3
        $doc = $params->getRawParam(1, '');
37
38 3
        $route->getExceptionHandler()->addExceptions($type, $doc);
39
    }
40
}