You are here

public static function Kint_Decorators_Rich::wrapEnd in Devel 8.2

Same name and namespace in other branches
  1. 8 kint/kint/decorators/rich.php \Kint_Decorators_Rich::wrapEnd()

* closes Kint::_wrapStart() started html tags and displays callee information * *

Parameters

array $callee caller information taken from debug backtrace: * @param array $miniTrace full path to kint call * @param array $prevCaller previous caller information taken from debug backtrace * * @return string

File

kint/kint/decorators/rich.php, line 193

Class

Kint_Decorators_Rich

Code

public static function wrapEnd($callee, $miniTrace, $prevCaller) {
  if (!Kint::$displayCalledFrom) {
    return '</div>';
  }
  $callingFunction = '';
  $calleeInfo = '';
  $traceDisplay = '';
  if (isset($prevCaller['class'])) {
    $callingFunction = $prevCaller['class'];
  }
  if (isset($prevCaller['type'])) {
    $callingFunction .= $prevCaller['type'];
  }
  if (isset($prevCaller['function']) && !in_array($prevCaller['function'], array(
    'include',
    'include_once',
    'require',
    'require_once',
  ))) {
    $callingFunction .= $prevCaller['function'] . '()';
  }
  $callingFunction and $callingFunction = " [{$callingFunction}]";
  if (isset($callee['file'])) {
    $calleeInfo .= 'Called from ' . self::_ideLink($callee['file'], $callee['line']);
  }
  if (!empty($miniTrace)) {
    $traceDisplay = '<ol>';
    foreach ($miniTrace as $step) {
      $traceDisplay .= '<li>' . self::_ideLink($step['file'], $step['line']);

      // closing tag not required
      if (isset($step['function']) && !in_array($step['function'], array(
        'include',
        'include_once',
        'require',
        'require_once',
      ))) {
        $classString = ' [';
        if (isset($step['class'])) {
          $classString .= $step['class'];
        }
        if (isset($step['type'])) {
          $classString .= $step['type'];
        }
        $classString .= $step['function'] . '()]';
        $traceDisplay .= $classString;
      }
    }
    $traceDisplay .= '</ol>';
    $calleeInfo = '<nav></nav>' . $calleeInfo;
  }
  return "<footer>" . '<span class="kint-popup-trigger" title="Open in new window">&rarr;</span> ' . "{$calleeInfo}{$callingFunction}{$traceDisplay}" . "</footer></div>";
}