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.
Passed
Pull Request — master (#61)
by Simone
02:08
created

ConfigProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getRequest() 0 3 1
A __construct() 0 7 1
A getUserRoles() 0 3 1
A getUser() 0 3 1
1
<?php
2
3
namespace Mado\QueryBundle\Services;
4
5
use Mado\QueryBundle\Component\ConfigProvider as ConfigProviderInterface;
6
use Symfony\Component\HttpFoundation\RequestStack;
7
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
8
9
class ConfigProvider implements ConfigProviderInterface
10
{
11
    private $user;
12
13
    private $request;
14
15
    public function __construct(
16
        RequestStack $requestStack,
17
        TokenStorage $tokenStorage
18
    ) {
19
        $this->token   = $tokenStorage->getToken();
0 ignored issues
show
Bug Best Practice introduced by
The property token does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
20
        $this->user    = $this->token->getUser();
0 ignored issues
show
Bug introduced by
The method getUser() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
        /** @scrutinizer ignore-call */ 
21
        $this->user    = $this->token->getUser();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
21
        $this->request = $requestStack->getCurrentRequest();
22
    }
23
24
    public function getUser()
25
    {
26
        return $this->user;
27
    }
28
29
    public function getRequest()
30
    {
31
        return $this->request;
32
    }
33
34
    public function getUserRoles()
35
    {
36
        return $this->token->getRoles();
37
    }
38
}
39