Skip to content

Commit

Permalink
Aligned HiddenLocationException with Symfony 6
Browse files Browse the repository at this point in the history
  • Loading branch information
alongosz committed Oct 31, 2024
1 parent c257a1f commit 1abf9cf
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/lib/MVC/Exception/HiddenLocationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1abf9cf

Please sign in to comment.