CpeException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 4
1
<?php
2
3
namespace SA\CpeSdk;
4
5
// Custom exception class for the Cloud Processing Engine
6
class CpeException extends \Exception
7
{
8
    public $ref;
9
    
10
    // Redefine constructor so 'message' isn't optional
11
    public function __construct($message, $ref = "", $code = 0, $previous = null)
12
    {
13
        $this->ref = $ref;
14
        parent::__construct($message, $code, $previous);
15
    }
16
    
17
    // custom string representation of object
18
    public function __toString() {
19
        return __CLASS__ . ": [{$this->ref}]: {$this->message}\n";
20
    }
21
}
22