AppIsInstalled::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 8
rs 9.4286
cc 2
eloc 4
nc 2
nop 2
1
<?php
2
3
/*
4
 * This file is part of Gitamin.
5
 *
6
 * Copyright (C) 2015-2016 The Gitamin Team
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Gitamin\Http\Middleware;
13
14
use Closure;
15
use Gitamin\Facades\Setting;
16
use Illuminate\Support\Facades\Redirect;
17
18
class AppIsInstalled
19
{
20
    /**
21
     * Run the app is installed middleware.
22
     *
23
     * We're verifying that Gitamin is correctly installed. If it is, then we're
24
     * redirecting the user to the dashboard so they can use Gitamin.
25
     *
26
     * @param \Illuminate\Routing\Route $route
0 ignored issues
show
Bug introduced by
There is no parameter named $route. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
27
     * @param \Closure                  $next
28
     *
29
     * @return mixed
30
     */
31
    public function handle($request, Closure $next)
32
    {
33
        if (Setting::get('app_name')) {
34
            return Redirect::to('dashboard');
35
        }
36
37
        return $next($request);
38
    }
39
}
40