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.
Completed
Pull Request — master (#39)
by
unknown
09:25 queued 07:45
created

CacheAllSuccessfulGetRequestsBasedOnSessionId   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A cacheNameSuffix() 0 4 1
1
<?php
2
3
namespace Spatie\ResponseCache\CacheProfiles;
4
5
use Illuminate\Http\Request;
6
use Symfony\Component\HttpFoundation\Response;
7
8
class CacheAllSuccessfulGetRequestsBasedOnSessionId extends CacheAllSuccessfulGetRequests
9
{
10
    /**
11
     * Set a string to add to differentiate this request from others.
12
     *
13
     * @return string
14
     */
15
    public function cacheNameSuffix(Request $request)
16
    {
17
        return $this->app->session->all();
0 ignored issues
show
Bug introduced by
Accessing session on the interface Illuminate\Contracts\Foundation\Application suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
18
    }
19
20
21
22
}
23