RouterProvider::getRoutes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 5
cts 5
cp 1
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gewaer\Providers;
6
7
use Canvas\Providers\RouterProvider as CanvasRouterProvider;
8
use function Canvas\Core\appPath;
9
use Phalcon\Di;
10
11
class RouterProvider extends CanvasRouterProvider
12
{
13
    /**
14
     * Returns the array for all the routes on this system.
15
     *
16
     * @return array
17 76
     */
18
    protected function getRoutes(): array
19 76
    {
20 76
        $path = appPath('api/routes');
21
22
        //app routes
23
        $routes = [
24 76
            'canvas' => Di::getDefault()->getConfig()->application->core->path . '/routes/api.php',
25 76
            'api' => $path . '/api.php',
26
        ];
27
28 76
        return $routes;
29
    }
30
}
31