forked from GNUsocial/gnu-social
[CORE][Symfony] Fixed deprecation resultant from Symfony 5.1 upgrade
User Deprecated: Since symfony/framework-bundle 5.1: Using type "Symfony\Component\Routing\RouteCollectionBuilder" for argument 1 of method "App\Kernel:configureRoutes()" is deprecated, use "Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator" instead.
This commit is contained in:
@@ -31,14 +31,13 @@
|
||||
namespace App;
|
||||
|
||||
use App\DependencyInjection\Compiler\SchemaDefPass;
|
||||
|
||||
use const PHP_VERSION_ID;
|
||||
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
|
||||
use Symfony\Component\Config\Loader\LoaderInterface;
|
||||
use Symfony\Component\Config\Resource\FileResource;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
|
||||
use Symfony\Component\Routing\RouteCollectionBuilder;
|
||||
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
|
||||
|
||||
class Kernel extends BaseKernel
|
||||
{
|
||||
@@ -103,13 +102,17 @@ class Kernel extends BaseKernel
|
||||
$loader->load($confDir . '/{services}_' . $this->environment . self::CONFIG_EXTS, 'glob');
|
||||
}
|
||||
|
||||
protected function configureRoutes(RouteCollectionBuilder $routes): void
|
||||
protected function configureRoutes(RoutingConfigurator $routes): void
|
||||
{
|
||||
$confDir = $this->getProjectDir() . '/config';
|
||||
$config = \dirname(__DIR__) . '/config';
|
||||
$routes->import($config . '/{routes}/' . $this->environment . '/*.yaml');
|
||||
$routes->import($config . '/{routes}/*.yaml');
|
||||
|
||||
$routes->import($confDir . '/{routes}/' . $this->environment . '/*' . self::CONFIG_EXTS, '/', 'glob');
|
||||
$routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS, '/', 'glob');
|
||||
$routes->import($confDir . '/{routes}' . self::CONFIG_EXTS, '/', 'glob');
|
||||
if (is_file($config . '/routes.yaml')) {
|
||||
$routes->import($config . '/{routes}.yaml');
|
||||
} elseif (is_file($path = $config . '/routes.php')) {
|
||||
(require $path)($routes->withPath($path), $this);
|
||||
}
|
||||
}
|
||||
|
||||
protected function build(ContainerBuilder $container): void
|
||||
|
Reference in New Issue
Block a user