ExceptionHandler::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 5
ccs 0
cts 3
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace PhpOffice\PhpSpreadsheet\Calculation;
4
5
class ExceptionHandler
6
{
7
    /**
8
     * Register errorhandler.
9
     */
10
    public function __construct()
11
    {
12
        /** @var callable $callable */
13
        $callable = [Exception::class, 'errorHandlerCallback'];
14
        set_error_handler($callable, E_ALL);
15
    }
16
17
    /**
18
     * Unregister errorhandler.
19
     */
20
    public function __destruct()
21
    {
22
        restore_error_handler();
23
    }
24
}
25