ALoopAdapter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 11
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A error() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AlecRabbit\Spinner\Core\Loop\Contract\A;
6
7
use AlecRabbit\Spinner\Core\Loop\Contract\ILoop;
8
9
/**
10
 * @codeCoverageIgnore
11
 */
12
abstract class ALoopAdapter implements ILoop
13
{
14
    protected static function error(): bool
15
    {
16
        // [889ad594-ca28-4770-bb38-fd5bd8cb1777]:
17
        // will be `null` if error handler set by `set_error_handler()` successfully handled the error
18
        $error = error_get_last();
19
20
        return (bool)(($error['type'] ?? 0)
21
            &
22
            (E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR));
23
    }
24
}
25