FatalErrorHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 13
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 11 2
1
<?php
2
/**
3
 * Class for fatal errors handling
4
 *
5
 * @file      FatalErrorHandler.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:02
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 FatalErrorHandler
20
 * @author  Yancharuk Alexander <alex at itvault dot info>
21
 */
22
class FatalErrorHandler extends BaseErrorHandler
23
{
24 1
	public function run()
25
	{
26 1
		if (null === ($this->vars = error_get_last())) {
27 1
			return;
28
		}
29
30 1
		$this->vars['time']    = $this->getTime();
31 1
		$this->vars['stack']   = [];
32 1
		$this->vars['defined'] = [];
33
34 1
		$this->notify();
35
	}
36
}
37