PotatoException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 3
1
<?php
2
3
namespace Ganga\Potato;
4
5
use Exception;
6
7
/**
8
 * Custom Exception Class for Urban Words Manager
9
 */
10
class PotatoException extends Exception
11
{
12
    // Redefine the exception so message isn't optional
13
    public function __construct($message, $code = 1, Exception $previous = null)
14
    {
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