Passed
Push — 12539-fix-accept-response-code ( 9f381c )
by Alexander
86:02 queued 79:15
created

NotAcceptableHttpException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 3
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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
 * NotAcceptableHttpException represents a "Not Acceptable" HTTP exception with status code 406.
12
 *
13
 * Use this exception when the client requests a Content-Type that your
14
 * application cannot return. Note that, according to the HTTP 1.1 specification,
15
 * you are not required to respond with this status code in this situation.
16
 *
17
 * @see https://tools.ietf.org/html/rfc7231#section-6.5.6
18
 * @author Dan Schmidt <[email protected]>
19
 * @since 2.0
20
 */
21
class NotAcceptableHttpException extends HttpException
22
{
23
    /**
24
     * Constructor.
25
     * @param string $message error message
26
     * @param int $code error code
27
     * @param \Exception $previous The previous exception used for the exception chaining.
28
     */
29 1
    public function __construct($message = null, $code = 0, \Exception $previous = null)
30
    {
31 1
        parent::__construct(406, $message, $code, $previous);
32 1
    }
33
}
34