* @param string $message
* @param string $file
* @param int $line
+ * @return bool
*
* @see logError()
*/
public static function prettyPrintTrace( array $trace, $pad = '' ) {
$text = '';
+ $level = 0;
foreach ( $trace as $level => $frame ) {
if ( isset( $frame['file'] ) && isset( $frame['line'] ) ) {
$text .= "{$pad}#{$level} {$frame['file']}({$frame['line']}): ";
$text .= "{$pad}#{$level} [internal function]: ";
}
- if ( isset( $frame['class'] ) ) {
+ if ( isset( $frame['class'] ) && isset( $frame['type'] ) && isset( $frame['function'] ) ) {
$text .= $frame['class'] . $frame['type'] . $frame['function'];
- } else {
+ } elseif ( isset( $frame['function'] ) ) {
$text .= $frame['function'];
+ } else {
+ $text .= 'NO_FUNCTION_GIVEN';
}
if ( isset( $frame['args'] ) ) {