ExceptionHandler   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 15
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 13 1
1
<?php
2
/**
3
 * Class for exception handling
4
 *
5
 * @file      ExceptionHandler.php
6
 *
7
 * PHP version 8.0+
8
 *
9
 * @author    Yancharuk Alexander <alex at itvault dot info>
10
 * @copyright © 2012-2021 Alexander Yancharuk
11
 * @date      2015-08-10 06:03
12
 * @license   The BSD 3-Clause License
13
 *            <https://tldrlegal.com/license/bsd-3-clause-license-(revised)>
14
 */
15
16
namespace Veles\ErrorHandler;
17
18
/**
19
 * Class ExceptionHandler
20
 * @author  Yancharuk Alexander <alex at itvault dot info>
21
 */
22
class ExceptionHandler extends BaseErrorHandler
23
{
24 3
	public function run(\Throwable $exception)
25
	{
26 3
		$this->vars = [
27 3
			'time'    => $this->getTime(),
28 3
			'message' => $exception->getMessage(),
29 3
			'file'    => $exception->getFile(),
30 3
			'line'    => $exception->getLine(),
31 3
			'stack'   => array_reverse($exception->getTrace()),
32 3
			'type'    => $exception->getCode(),
33 3
			'defined' => ['exception' => $exception]
34 3
		];
35
36 3
		$this->notify();
37
	}
38
}
39