Completed
Push — master ( c432ac...8e117f )
by Mathijs
04:01
created

BaseException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 11
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCallerInfo() 0 7 1
1
<?php
2
3
namespace mcorten87\rabbitmq_api\exceptions;
4
5
6
use mcorten87\rabbitmq_api\objects\CallerObjectInfo;
7
8
class BaseException extends \Exception
9
{
10
11
    protected function getCallerInfo() : CallerObjectInfo {
12
        $backtrace = debug_backtrace();
13
        $backtrace = $backtrace[2]; // 0 = InvalidDataException, 1 = BaseObject, 2 = the Object we need
14
15
        $callerObjectInfo = new CallerObjectInfo($backtrace['file'], $backtrace['args'][0]);
16
        return $callerObjectInfo;
17
    }
18
}
19