Completed
Push — master ( da6964...f96373 )
by Thomas
17s
created

ErrorHandler::handleError()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 4
dl 0
loc 10
ccs 0
cts 5
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the ekino Drupal Debug project.
7
 *
8
 * (c) ekino
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Ekino\Drupal\Debug\Action\ThrowErrorsAsExceptions;
15
16
use Symfony\Component\Debug\ErrorHandler as BaseErrorHandler;
17
18
// TODO : useless if https://github.com/symfony/symfony/pull/29869 is merged
19
class ErrorHandler extends BaseErrorHandler
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function handleError($type, $message, $file, $line): bool
25
    {
26
        $result = parent::handleError($type, $message, $file, $line);
27
28
        \set_error_handler(array(
29
            $this,
30
            __FUNCTION__,
31
        ));
32
33
        return $result;
34
    }
35
}
36