CpeException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 16
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __toString() 0 3 1
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