Exception   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 34
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 3
1
<?php
2
3
namespace CloudyCity\IPayNowSDK\Exceptions;
4
5
class Exception extends \Exception
6
{
7
    const UNKNOWN_ERROR = 9999;
8
9
    const INVALID_CONFIG = 1;
10
11
    const ERROR_GATEWAY = 2;
12
13
    const INVALID_SIGN = 3;
14
15
    const ERROR_BUSINESS = 4;
16
17
    /**
18
     * Raw error info.
19
     *
20
     * @var array
21
     */
22
    public $raw;
23
24
    /**
25
     * Bootstrap.
26
     *
27
     * @param string       $message
28
     * @param array|string $raw
29
     * @param int|string   $code
30
     */
31
    public function __construct($message = '', $raw = [], $code = self::UNKNOWN_ERROR)
32
    {
33
        $message = '' === $message ? 'Unknown Error' : $message;
34
        $this->raw = is_array($raw) ? $raw : [$raw];
35
36
        parent::__construct($message, intval($code));
37
    }
38
}
39