Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

RouteProvider::handle()   B
last analyzed

Complexity

Conditions 6
Paths 5

Size

Total Lines 18
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 6
eloc 7
nc 5
nop 3
dl 0
loc 18
rs 8.8571
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Mark
5
 * Date: 28/01/2017
6
 * Time: 03:33.
7
 */
8
9
namespace App\Http\Middleware;
10
11
use Closure;
12
use App\Model\Plugin;
13
use Illuminate\Routing\Router;
14
use App\Classes\Interfaces\RouteableInterface;
0 ignored issues
show
Bug introduced by
The type App\Classes\Interfaces\RouteableInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
16
/**
17
 * Class SettingsProvider.
18
 */
19
class RouteProvider
20
{
21
    /**
22
     * Handle an incoming request.
23
     *
24
     * @param  \Illuminate\Http\Request  $request
25
     * @param  string|null  $guard
26
     * @return mixed
27
     */
28
    public function handle($request, Closure $next, $guard = null)
0 ignored issues
show
Unused Code introduced by
The parameter $guard is not used and could be removed. ( Ignorable by Annotation )

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

28
    public function handle($request, Closure $next, /** @scrutinizer ignore-unused */ $guard = null)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
29
    {
30
        $router = app('router');
31
32
        /** @var Plugin $plugin */
33
        foreach (plugins()->enabled() as $plugin) {
34
            // does not require authentication.
35
            if ($plugin->isFrontEnd() && userPluginController($plugin->name()) instanceof RouteableInterface) {
0 ignored issues
show
Bug introduced by
The function userPluginController was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

35
            if ($plugin->isFrontEnd() && /** @scrutinizer ignore-call */ userPluginController($plugin->name()) instanceof RouteableInterface) {
Loading history...
36
                $this->loadPluginRoutes(userPluginController($plugin->name(), null, false), $router);
37
            }
38
39
            // requires authentication
40
            if ($plugin->isBackEnd() && adminPluginController($plugin->name()) instanceof RouteableInterface) {
0 ignored issues
show
Bug introduced by
The function adminPluginController was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

40
            if ($plugin->isBackEnd() && /** @scrutinizer ignore-call */ adminPluginController($plugin->name()) instanceof RouteableInterface) {
Loading history...
41
                $this->loadPluginRoutes(adminPluginController($plugin->name(), null, false), $router);
42
            }
43
        }
44
45
        return $next($request);
46
    }
47
48
    /**
49
     * Load the plugin controller route method.
50
     * Since plugin routes need to exist on boot.
51
     * For people to use no matter what page they
52
     * are in.
53
     *
54
     * @param RouteableInterface $plugin
55
     * @param Router $withRouter
56
     */
57
    private function loadPluginRoutes(RouteableInterface $plugin, Router $withRouter)
58
    {
59
        $plugin->routes($withRouter);
60
    }
61
}
62