Issues (104)

fallback-routes.php (1 issue)

1
<?php
2
3
declare(strict_types=1);
4
5
use AbterPhp\Admin\Config\Routes as RoutesConfig;
6
use AbterPhp\Admin\Constant\Route as RouteConstant;
7
use AbterPhp\Admin\Http\Middleware\Api;
8
use Opulence\Routing\Router;
9
10
/**
11
 * ----------------------------------------------------------
12
 * Create all of the routes for the HTTP kernel
13
 * ----------------------------------------------------------
14
 *
15
 * @var Router $router
16
 */
17
$router->group(
18
    ['controllerNamespace' => 'AbterPhp\Admin\\Http\\Controllers'],
19
    function (Router $router) {
20
        $router->group(
21
            [
22
                'path'       => RoutesConfig::getApiBasePath(),
0 ignored issues
show
Bug Best Practice introduced by
The method AbterPhp\Admin\Config\Routes::getApiBasePath() is not static, but was called statically. ( Ignorable by Annotation )

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

22
                'path'       => RoutesConfig::/** @scrutinizer ignore-call */ getApiBasePath(),
Loading history...
23
                'middleware' => [
24
                    Api::class,
25
                ],
26
            ],
27
            function (Router $router) {
28
                /** @see \AbterPhp\Admin\Http\Controllers\Api\Index::notFound() */
29
                $router->any(
30
                    '/:anything',
31
                    'Api\Index@notFound',
32
                    [
33
                        RouteConstant::OPTION_VARS => [RouteConstant::VAR_ANYTHING => '.+'],
34
                    ]
35
                );
36
            }
37
        );
38
    }
39
);
40