Passed
Push — master ( 8cc9a0...f951ba )
by karam
06:13 queued 03:49
created

KMRoutes::getRoutes()   A

Complexity

Conditions 5
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
nc 1
nop 0
dl 0
loc 8
c 0
b 0
f 0
cc 5
rs 9.6111
1
<?php
2
3
namespace KMLaravel\ApiGenerator\Helpers;
4
5
use Illuminate\Support\Facades\Route;
1 ignored issue
show
Bug introduced by
The type Illuminate\Support\Facades\Route 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...
6
use KMLaravel\ApiGenerator\Facade\KMFileFacade;
7
8
class KMRoutes
9
{
10
    public static function getRoutes()
11
    {
12
        return Route::group([], function () {
13
            $extraRoutes = KMFileFacade::getCredentialJsonFileAsJson();
14
            if (isset($extraRoutes)){
15
                foreach ($extraRoutes as $api) {
16
                    if (isset($api->route) && isset($api->url)) {
17
                        Route::apiResource($api->url, $api->route);
18
                    }
19
                }
20
            }
21
        });
22
    }
23
}
24