From 1abf9cf485edea082cdf5848f1465bf132252d41 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 30 Oct 2024 19:08:54 +0100 Subject: [PATCH] Aligned HiddenLocationException with Symfony 6 --- src/lib/MVC/Exception/HiddenLocationException.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/lib/MVC/Exception/HiddenLocationException.php b/src/lib/MVC/Exception/HiddenLocationException.php index 1c8fabd454..1117bcea76 100644 --- a/src/lib/MVC/Exception/HiddenLocationException.php +++ b/src/lib/MVC/Exception/HiddenLocationException.php @@ -4,27 +4,25 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ +declare(strict_types=1); namespace Ibexa\Core\MVC\Exception; use Ibexa\Contracts\Core\Repository\Values\Content\Location; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Throwable; class HiddenLocationException extends NotFoundHttpException { - /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location */ - private $location; + private Location $location; - public function __construct(Location $location, $message = null, \Exception $previous = null, $code = 0) + public function __construct(Location $location, ?string $message = null, ?Throwable $previous = null, int $code = 0) { $this->location = $location; - parent::__construct($message, $previous, $code); + parent::__construct($message ?? 'HTTP Not Found', $previous, $code); } - /** - * @return \Ibexa\Contracts\Core\Repository\Values\Content\Location - */ - public function getLocation() + public function getLocation(): Location { return $this->location; }