Completed
Push — 2.1 ( 37580d...257604 )
by
unknown
12:15
created

ForbiddenHttpException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 3
crap 2
1
<?php
2
/**
3
 * @link http://www.yiiframework.com/
4
 * @copyright Copyright (c) 2008 Yii Software LLC
5
 * @license http://www.yiiframework.com/license/
6
 */
7
8
namespace yii\web;
9
10
/**
11
 * ForbiddenHttpException represents a "Forbidden" HTTP exception with status code 403.
12
 *
13
 * Use this exception when a user is not allowed to perform the requested action.
14
 * Using different credentials might or might not allow performing the requested action.
15
 * If you do not want to expose authorization information to the user, it is valid
16
 * to respond with a 404 [[NotFoundHttpException]].
17
 *
18
 * @see https://tools.ietf.org/html/rfc7231#section-6.5.3
19
 * @author Dan Schmidt <[email protected]>
20
 * @since 2.0
21
 */
22
class ForbiddenHttpException extends HttpException
23
{
24
    /**
25
     * Constructor.
26
     * @param string $message error message
27
     * @param int $code error code
28
     * @param \Exception $previous The previous exception used for the exception chaining.
29
     */
30
    public function __construct($message = null, $code = 0, \Exception $previous = null)
31
    {
32
        parent::__construct(403, $message, $code, $previous);
33
    }
34
}
35