NotFoundException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 3
crap 2
1
<?php
2
3
namespace TreeHouse\BaseApiBundle\Exception;
4
5
/**
6
 * Exception for when a resource is not found
7
 */
8
class NotFoundException extends ApiException
9
{
10
    /**
11
     * @var integer
12
     */
13
    protected $statusCode;
14
15
    /**
16
     * @param string     $message  The internal exception message
17
     * @param \Exception $previous The previous exception
18
     * @param integer    $code     The internal exception code
19
     */
20
    public function __construct($message = null, \Exception $previous = null, $code = 0)
21
    {
22
        $this->statusCode = 404;
23
24
        parent::__construct($message, $code, $previous);
25
    }
26
27
    /**
28
     * @return integer
29
     */
30
    public function getStatusCode()
31
    {
32
        return $this->statusCode;
33
    }
34
}
35