ClientExceptions   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 60%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 47
ccs 6
cts 10
cp 0.6
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A accessDenied() 0 4 1
A recordNotFound() 0 4 1
A invalidArgument() 0 4 1
1
<?php
2
3
namespace PreviewTechs\cPanelWHM\Exceptions;
4
5
class ClientExceptions extends \Exception
6
{
7
    protected $reason;
8
9 1
    public function __construct($message = "", $code = 0, $reason = null)
10
    {
11 1
        $this->reason = $reason;
12
13 1
        parent::__construct($message, $code);
14 1
    }
15
16
    /**
17
     *
18
     * @param $message
19
     * @param $reason
20
     *
21
     * @return ClientExceptions
22
     */
23 1
    public static function accessDenied($message, $reason = null)
24
    {
25 1
        return new static($message, 0, $reason);
26
    }
27
28
    /**
29
     *
30
     * @param $message
31
     * @param $reason
32
     *
33
     * @return ClientExceptions
34
     */
35
    public static function recordNotFound($message, $reason = null)
36
    {
37
        return new static($message, 0, $reason);
38
    }
39
40
    /**
41
     *
42
     * @param $message
43
     * @param $reason
44
     *
45
     * @return ClientExceptions
46
     */
47
    public static function invalidArgument($message, $reason = null)
48
    {
49
        return new static($message, 0, $reason);
50
    }
51
}
52