PhpException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 4
dl 0
loc 13
ccs 5
cts 5
cp 1
crap 1
rs 9.4285
1
<?php
2
/**
3
 * In this file the exception class '\UK\Core\PhpException' is defined.
4
 *
5
 * @author         UniKado <[email protected]>
6
 * @copyright  (c) 2016, UniKado
7
 * @package        UK
8
 * @since          2016-06-24
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 is used by UniKado error handler. It will only be thrown by the error handler, if a
22
 * catchable error occurs.
23
 *
24
 * <b>ATTENTION!</b> Never throw this exception inside your code!
25
 *
26
 * @since v0.1.0
27
 */
28
class PhpException extends CoreException
29
{
30
31
32
   // <editor-fold desc="// = = = =   P U B L I C   C O N S T R U C T O R   = = = = = = = = = = = = = = = = = = = = =">
33
34
   /**
35
    * Init's a new instance. Don't use it inside you're code!
36
    *
37
    * @param string  $message  The error message.
38
    * @param integer $code     The error code.
39
    * @param integer $line     The error line.
40
    * @param string  $file     The error file.
41
    */
42 1
   public function __construct( string $message, int $code, int $line, string $file )
43
   {
44
45
      // Call the parent constructor
46 1
      parent::__construct( \strip_tags( $message ), $code );
47
48
      // Setting the error file manually.
49 1
      $this->file = $file;
50
51
      // Setting the error line manually.
52 1
      $this->line = $line;
53
54 1
   }
55
56
   // </editor-fold>
57
58
59
}
60
61