Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
ForbiddenException
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3/**
4 * Forbidden Exception for phpMyFAQ
5 *
6 * This Source Code Form is subject to the terms of the Mozilla Public License,
7 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
8 * obtain one at https://mozilla.org/MPL/2.0/.
9 *
10 * @package   phpMyFAQ
11 * @author    Thorsten Rinne <thorsten@phpmyfaq.de>
12 * @copyright 2025-2026 phpMyFAQ Team
13 * @license   https://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
14 * @link      https://www.phpmyfaq.de
15 * @since     2025-12-07
16 */
17
18declare(strict_types=1);
19
20namespace phpMyFAQ\Controller\Exception;
21
22use Symfony\Component\HttpFoundation\Response;
23use Symfony\Component\HttpKernel\Exception\HttpException;
24use Throwable;
25
26class ForbiddenException extends HttpException
27{
28    public function __construct(
29        string $message = 'Forbidden',
30        ?Throwable $previous = null,
31        int $code = 0,
32        array $headers = [],
33    ) {
34        parent::__construct(
35            statusCode: Response::HTTP_FORBIDDEN,
36            message: $message,
37            previous: $previous,
38            headers: $headers,
39            code: $code,
40        );
41    }
42}