RouteServiceProvider::loadRoutesFile()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 1
nop 3
crap 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