mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
N°6934 - Symfony 6.4 - upgrade Symfony bundles to 6.4 (#580)
* Update Symfony lib to version ~6.4.0 * Update code missing return type * Add an iTop general configuration entry to store application secret (Symfony mandatory parameter) * Use dependency injection in ExceptionListener & UserProvider classes
This commit is contained in:
@@ -29,9 +29,9 @@ use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
*/
|
||||
class FragmentHandler
|
||||
{
|
||||
private $debug;
|
||||
private $renderers = [];
|
||||
private $requestStack;
|
||||
private bool $debug;
|
||||
private array $renderers = [];
|
||||
private RequestStack $requestStack;
|
||||
|
||||
/**
|
||||
* @param FragmentRendererInterface[] $renderers An array of FragmentRendererInterface instances
|
||||
@@ -48,6 +48,8 @@ class FragmentHandler
|
||||
|
||||
/**
|
||||
* Adds a renderer.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addRenderer(FragmentRendererInterface $renderer)
|
||||
{
|
||||
@@ -61,14 +63,10 @@ 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
|
||||
*
|
||||
* @return string|null
|
||||
*
|
||||
* @throws \InvalidArgumentException when the renderer does not exist
|
||||
* @throws \LogicException when no main request is being handled
|
||||
*/
|
||||
public function render($uri, string $renderer = 'inline', array $options = [])
|
||||
public function render(string|ControllerReference $uri, string $renderer = 'inline', array $options = []): ?string
|
||||
{
|
||||
if (!isset($options['ignore_errors'])) {
|
||||
$options['ignore_errors'] = !$this->debug;
|
||||
@@ -95,7 +93,7 @@ class FragmentHandler
|
||||
*
|
||||
* @throws \RuntimeException when the Response is not successful
|
||||
*/
|
||||
protected function deliver(Response $response)
|
||||
protected function deliver(Response $response): ?string
|
||||
{
|
||||
if (!$response->isSuccessful()) {
|
||||
$responseStatusCode = $response->getStatusCode();
|
||||
|
||||
Reference in New Issue
Block a user