Exception   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 42
ccs 3
cts 3
cp 1
rs 10
wmc 3
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A appendMessage() 0 6 2
1
<?php
2
/**
3
 * In this file the UniKado Core exception class '\UK\Exception' is defined.
4
 *
5
 * @author         UniKado <[email protected]>
6
 * @copyright  (c) 2016, UniKado
7
 * @package        UK
8
 * @since          2016-04-29
9
 * @subpackage     Errors
10
 * @version        0.1.0
11
 */
12
13
14
declare( strict_types = 1 );
15
16
17
namespace UK;
18
19
20
/**
21
 * This Exception defines the base functionality for all other Framework exceptions.
22
 *
23
 * @since  v0.1
24
 */
25
class Exception extends CoreException
26
{
27
28
29
   # <editor-fold desc="= = =   C O N S T R U C T O R   +   D E S T R U C T O R   = = = = = = = = = = = = = = =">
30
31
   /**
32
    * Init's a new instance.
33
    *
34
    * @param string     $message  The error message
35
    * @param int        $code     The optional Error code (defaults to \E_ERROR)
36
    * @param \Exception $previous A optional previous exception
37
    */
38 2
   public function __construct( string $message, int $code = \E_ERROR, \Exception $previous = null )
39
   {
40
41 2
      parent::__construct( $message, $code, $previous );
42
43 2
   }
44
45
   # </editor-fold>
46
47
48
   # <editor-fold desc="= = =   P R O T E C T E D   S T A T I C   M E T H O D S   = = = = = = = = = = = = = = =">
49
50
   /**
51
    * Appends a message, if its not empty, separated by ' '.
52
    *
53
    * @param  string $message
54
    * @return string
55
    */
56
   protected static function appendMessage( $message ) : string
57
   {
58
59
      return empty( $message ) ? '' : ( ' ' . $message );
60
61
   }
62
63
   # </editor-fold>
64
65
66
}
67
68