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

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

        return new $class();
    }
protected function resolveClass ( ? ContainerInterface $ container = null , string $ class ) { if ( $ container instanceof ContainerInterface && $ container -> has ( $ class ) ) { return $ container -> get ( $ class ) ; } return new $ class ( ) ; }
Get an object instance from a class name

@param \Psr\Container\ContainerInterface|null $container
@param string $class

@return object
Get an object instance from a class name