RouteServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 14
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A loadRoutesFile() 0 5 2
1
<?php
2
3
namespace Anfischer\Foundation\Providers;
4
5
use Illuminate\Routing\Router;
6
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as BaseServiceProvider;
7
8
abstract class RouteServiceProvider extends BaseServiceProvider
9
{
10
    /**
11
     * Read the routes from the "routes.php" file of this Service
12
     *
13
     * @param \Illuminate\Routing\Router $router
14
     */
15
    abstract public function map(Router $router);
16
17 2
    public function loadRoutesFile($router, $namespace, $path) : void
18
    {
19
        $router->group(['namespace' => $namespace], function ($router) use ($path) {
20 2
            if (file_exists($path)) {
21 2
                require $path;
22
            }
23 2
        });
24 2
    }
25
}
26