Exception::errorHandlerCallback()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 7
rs 10
ccs 0
cts 5
cp 0
cc 1
nc 1
nop 4
crap 2
1
<?php
2
3
namespace PhpOffice\PhpSpreadsheet\Calculation;
4
5
use PhpOffice\PhpSpreadsheet\Exception as PhpSpreadsheetException;
6
7
class Exception extends PhpSpreadsheetException
8
{
9
    public const CALCULATION_ENGINE_PUSH_TO_STACK = 1;
10
11
    /**
12
     * Error handler callback.
13
     */
14
    public static function errorHandlerCallback(int $code, string $string, string $file, int $line): void
15
    {
16
        $e = new self($string, $code);
17
        $e->line = $line;
18
        $e->file = $file;
19
20
        throw $e;
21
    }
22
}
23