ErrorsClassify   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A isGenericException() 0 3 3
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