Passed
Push — fix-tests ( 6dd538...727178 )
by Alexander
195:41 queued 192:18
created

NotAcceptableHttpException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 11
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
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