upgrade to laravel 7 and set branch to v2

This commit is contained in:
2020-12-25 11:22:15 +00:00
parent 516105c492
commit 0ddd298350
4638 changed files with 132501 additions and 190226 deletions

View File

@@ -15,6 +15,7 @@ use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\HttpKernel\Controller\ControllerReference;
use Symfony\Component\HttpKernel\Exception\HttpException;
/**
* Renders a URI that represents a resource fragment.
@@ -60,15 +61,14 @@ class FragmentHandler
*
* * ignore_errors: true to return an empty string in case of an error
*
* @param string|ControllerReference $uri A URI as a string or a ControllerReference instance
* @param string $renderer The renderer name
* @param string|ControllerReference $uri A URI as a string or a ControllerReference instance
*
* @return string|null The Response content or null when the Response is streamed
*
* @throws \InvalidArgumentException when the renderer does not exist
* @throws \LogicException when no master request is being handled
*/
public function render($uri, $renderer = 'inline', array $options = [])
public function render($uri, string $renderer = 'inline', array $options = [])
{
if (!isset($options['ignore_errors'])) {
$options['ignore_errors'] = !$this->debug;
@@ -98,7 +98,8 @@ class FragmentHandler
protected function deliver(Response $response)
{
if (!$response->isSuccessful()) {
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %d).', $this->requestStack->getCurrentRequest()->getUri(), $response->getStatusCode()));
$responseStatusCode = $response->getStatusCode();
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %d).', $this->requestStack->getCurrentRequest()->getUri(), $responseStatusCode), 0, new HttpException($responseStatusCode));
}
if (!$response instanceof StreamedResponse) {