ExceptionHandler::run()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 9
nc 1
nop 1
dl 0
loc 13
ccs 11
cts 11
cp 1
crap 1
rs 9.9666
c 0
b 0
f 0
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