NotFoundException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
1
<?php
2
/**
3
 * @author Todd Burry <[email protected]>
4
 * @copyright 2009-2014 Vanilla Forums Inc.
5
 * @license MIT
6
 */
7
8
namespace Garden\Exception;
9
10
/**
11
 * Represents a 404 not found error.
12
 */
13
class NotFoundException extends ClientException {
14
    /**
15
     * Initialize a {@link NotFoundException}.
16
     *
17
     * @param string $message The error message or a one word resource name.
18
     * @param string $description A longer description for the error.
19
     */
20 16
    public function __construct($message = 'Page', $description = null) {
21 16
        if (strpos($message, ' ') === false) {
22 16
            $message = sprintf('%s not found.', $message);
23 16
        }
24
25 16
        parent::__construct($message, 404, ['description' => $description]);
26 16
    }
27
}
28