ErrorsClassify::isGenericException()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 3
nc 3
nop 2
1
<?php
2
/**
3
 * Exceptions classify
4
 * User: moyo
5
 * Date: 01/02/2018
6
 * Time: 4:53 PM
7
 */
8
9
namespace Carno\HRPC\Client\Chips;
10
11
use Carno\RPC\Errors\GenericError;
12
use Carno\RPC\Exception\RemoteLogicException;
13
use Throwable;
14
15
trait ErrorsClassify
16
{
17
    /**
18
     * @param Throwable $e
19
     * @param bool $acceptLogic
20
     * @return bool
21
     */
22
    protected function isGenericException(Throwable $e, bool $acceptLogic = false) : bool
23
    {
24
        return $e instanceof GenericError && ($acceptLogic || !$e instanceof RemoteLogicException);
25
    }
26
}
27