ArghException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __toString() 0 2 1
1
<?php
2
	
3
/**
4
	* ArghException.php
5
	*/
6
	
7
namespace netfocusinc\argh;
8
	
9
/**
10
 	* An exception that is thrown by Argh
11
 	*
12
 	* A subclass of Exception that is thrown by Argh.
13
 	* 
14
 	* @author Benjamin Hough
15
 	*
16
 	* @since 1.0.0
17
 	* 
18
 	*/
19
class ArghException extends \Exception
20
{
21
		/**
22
			* Contruct a new ArghException with a required message
23
			*
24
			* @since 1.0.0
25
			*
26
			* @param string $message Custom message describing this Exception
27
			* @param int $code Custom error code
28
			* @param Exception $previous The previous Exception to occurr
0 ignored issues
show
Bug introduced by
The type netfocusinc\argh\Exception was not found. Did you mean Exception? If so, make sure to prefix the type with \.
Loading history...
29
			*
30
			*/
31
    public function __construct($message, $code = 0, \Exception $previous = null) {
32
        // some code
33
    
34
        // make sure everything is assigned properly
35
        parent::__construct($message, $code, $previous);
36
    }
37
38
39
		/**
40
			* Returns a descriptive string indentifying this Exception
41
			*
42
			* @since 1.0.0
43
			*
44
			* @return string
45
			*
46
			*/
47
    public function __toString() {
48
        return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
49
    }
50
    
51
}