SearchReplaceException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 3
dl 0
loc 4
rs 10
1
<?php namespace SearchReplace;
2
3
use \Exception;
4
5
/**
6
 * Class HughesException
7
 * @package HughesApi\Exception
8
 */
9
class SearchReplaceException extends Exception
10
{
11
    // Redefine the exception so message isn't optional
12
    public function __construct($message, $code = 0, Exception $previous = null)
13
    {
14
        // make sure everything is assigned properly
15
        parent::__construct($message, $code, $previous);
16
    }
17
18
    // custom string representation of object
19
    public function __toString()
20
    {
21
        return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
22
    }
23
}
24
25