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

BaseException::getCallerInfo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
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