+ // Get backtrace
+ $backtrace = debug_backtrace(!DEBUG_BACKTRACE_PROVIDE_OBJECT);
+
+ // Is function 'partialStub' ?
+ if ($backtrace[1]['function'] == 'partialStub') {
+ // Prepend class::function:line from 3rd element
+ $message = sprintf('[%s::%s:%d]: %s',
+ $backtrace[2]['class'],
+ $backtrace[2]['function'],
+ (isset($backtrace[2]['line']) ? $backtrace[2]['line'] : '0'),
+ $message
+ );
+ } else {
+ // Prepend class::function:line from 2nd element
+ $message = sprintf('[%s::%s:%d]: %s',
+ $backtrace[1]['class'],
+ $backtrace[1]['function'],
+ (isset($backtrace[1]['line']) ? $backtrace[1]['line'] : '0'),
+ $message
+ );
+ }
+