thephpleague / route

Fast PSR-7 based routing and dispatch component including PSR-15 middleware, built on top of FastRoute.
http://route.thephpleague.com
MIT License
651 stars 126 forks source link

PHP 8 Error #340

Open memran opened 3 months ago

memran commented 3 months ago

I am facing an error on php 8 which is : "Optional parameter $container declared before required parameter $class is implicitly treated as a required parameter"

code stopped at this function:

` protected function resolveClass(?ContainerInterface $container = null, string $class) { if ($container instanceof ContainerInterface && $container->has($class)) { return $container->get($class); }

    return new $class();
}

`