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
Push — master ( 869845...9ac565 )
by James
08:24 queued 03:31
created

StartFireflySession::storeCurrentUrl()   B

Complexity

Conditions 5
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 8.8571
cc 5
eloc 5
nc 2
nop 2
1
<?php
2
/**
3
 * StartFireflySession.php
4
 * Copyright (c) 2017 [email protected]
5
 *
6
 * This file is part of Firefly III.
7
 *
8
 * Firefly III is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU General Public License as published by
10
 * the Free Software Foundation, either version 3 of the License, or
11
 * (at your option) any later version.
12
 *
13
 * Firefly III is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with Firefly III.  If not, see <http://www.gnu.org/licenses/>.
20
 */
21
22
declare(strict_types=1);
23
24
namespace FireflyIII\Http\Middleware;
25
26
27
use Closure;
28
use Illuminate\Http\Request;
29
use Illuminate\Session\Middleware\StartSession;
30
31
/**
32
 * Class StartFireflySession
33
 *
34
 * @package FireflyIII\Http\Middleware
35
 */
36
class StartFireflySession extends StartSession
37
{
38
    /**
39
     * Handle an incoming request.
40
     *
41
     * @param  \Illuminate\Http\Request $request
42
     * @param  Closure                  $next
43
     *
44
     * @return mixed
45
     */
46
//    public function handle($request, Closure $next)
0 ignored issues
show
Unused Code Comprehensibility introduced by
52% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
47
//    {
48
//        return parent::handle($request, $next); // defer to the right stuff
49
//    }
50
51
    /**
52
     * Store the current URL for the request if necessary.
53
     *
54
     * @param  \Illuminate\Http\Request              $request
55
     * @param  \Illuminate\Contracts\Session\Session $session
56
     *
57
     * @return void
58
     */
59
    protected function storeCurrentUrl(Request $request, $session)
60
    {
61
        $uri    = $request->fullUrl();
62
        $strpos = strpos($uri, 'jscript');
63
        if ($request->method() === 'GET' && $request->route() && !$request->ajax() && $strpos === false) {
64
            $session->setPreviousUrl($uri);
65
        }
66
    }
67
}