__toString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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