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.

ClassAnnotationHandler   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 16
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 9 1
1
<?php
2
3
namespace PhpBoot\Controller\Annotations;
4
5
6
use PhpBoot\Annotation\AnnotationBlock;
7
use PhpBoot\Annotation\AnnotationTag;
8
use PhpBoot\Controller\ControllerContainer;
9
10
class ClassAnnotationHandler
11
{
12
    /**
13
     * @param ControllerContainer $container
14
     * @param AnnotationBlock|AnnotationTag $ann
15
     */
16 4
    public function __invoke(ControllerContainer $container, $ann)
17
    {
18 4
        $ref = new \ReflectionClass($container->getClassName());
19 4
        $container->getClassName();
0 ignored issues
show
Unused Code introduced by
The call to the method PhpBoot\Controller\Contr...ntainer::getClassName() seems un-needed as the method has no side-effects.

PHP Analyzer performs a side-effects analysis of your code. A side-effect is basically anything that might be visible after the scope of the method is left.

Let’s take a look at an example:

class User
{
    private $email;

    public function getEmail()
    {
        return $this->email;
    }

    public function setEmail($email)
    {
        $this->email = $email;
    }
}

If we look at the getEmail() method, we can see that it has no side-effect. Whether you call this method or not, no future calls to other methods are affected by this. As such code as the following is useless:

$user = new User();
$user->getEmail(); // This line could safely be removed as it has no effect.

On the hand, if we look at the setEmail(), this method _has_ side-effects. In the following case, we could not remove the method call:

$user = new User();
$user->setEmail('email@domain'); // This line has a side-effect (it changes an
                                 // instance variable).
Loading history...
20
21 4
        $container->setDescription($ann->description);
22 4
        $container->setSummary($ann->summary);
23 4
        $container->setFileName($ref->getFileName());
24
    }
25
}