for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace Arcanesoft\Foundation\Providers;
use Arcanedev\Support\Providers\RouteServiceProvider as ServiceProvider;
use Arcanesoft\Foundation\Http\Middleware;
use Arcanesoft\Foundation\Http\Routes;
use Illuminate\Routing\Router;
/**
* Class RouteServiceProvider
*
* @package Arcanesoft\Foundation\Providers
* @author ARCANEDEV <[email protected]>
*/
class RouteServiceProvider extends ServiceProvider
{
/* ------------------------------------------------------------------------------------------------
| Getters & Setters
| ------------------------------------------------------------------------------------------------
* Get the routes namespace
* @return string
protected function getRouteNamespace()
return 'Arcanesoft\\Foundation\\Http\\Routes';
}
* Get Foundation route group.
* @return array
protected function getFoundationRouteGroup()
return config('arcanesoft.foundation.route', []);
| Main Functions
* Define the routes for the application.
* @param Router $router
public function map(Router $router)
$this->middleware('admin', Middleware\AdminMiddleware::class);
'admin'
string
object<string>
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
$router->group($this->getFoundationRouteGroup(), function (Router $router) {
(new Routes\DashboardRoute())->map($router);
});
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: