';
} elseif ( isset( $var ) ) {
throw new Exception(
'Kint has encountered an error, '
. 'please paste this report to https://github.com/raveren/kint/issues '
. 'Error encountered at ' . basename( __FILE__ ) . ':' . __LINE__ . ' '
. ' variables: '
. htmlspecialchars( var_export( $kintVar->alternatives, true ), ENT_QUOTES )
);
}
$output .= "
";
}
$output .= "
";
}
if ( $extendedPresent ) {
$output .= '
';
}
$output .= '';
return $output;
}
private static function _drawHeader( kintVariableData $kintVar, $verbose = true )
{
$output = '';
if ( $verbose ) {
if ( $kintVar->access !== null ) {
$output .= "" . $kintVar->access . " ";
}
if ( $kintVar->name !== null && $kintVar->name !== '' ) {
$output .= "" . $kintVar->name . " ";
}
if ( $kintVar->operator !== null ) {
$output .= $kintVar->operator . " ";
}
}
if ( $kintVar->type !== null ) {
$output .= "" . $kintVar->type;
if ( $kintVar->subtype !== null ) {
$output .= " " . $kintVar->subtype;
}
$output .= " ";
}
if ( $kintVar->size !== null ) {
$output .= "(" . $kintVar->size . ") ";
}
return $output;
}
/**
* produces css and js required for display. May be called multiple times, will only produce output once per
* pageload or until `-` or `@` modifier is used
*
* @return string
*/
protected static function _css()
{
if ( !self::$_firstRun ) return '';
self::$_firstRun = false;
$baseDir = KINT_DIR . 'view/inc/';
if ( !is_readable( $cssFile = $baseDir . self::$theme . '.css' ) ) {
$cssFile = $baseDir . 'original.css';
}
return ''
. '\n";
}
/**
* called for each dump, opens the html tag
*
* @param array $callee caller information taken from debug backtrace
*
* @return string
*/
protected static function _wrapStart( $callee )
{
// colors looping outputs the same (i.e. if same line in code dumps variables multiple time,
// we assume it's in a loop)
$uid = isset( $callee['file'] ) ? crc32( $callee['file'] . $callee['line'] ) : 'no-file';
if ( isset( self::$_usedColors[$uid] ) ) {
$class = self::$_usedColors[$uid];
} else {
$class = sizeof( self::$_usedColors );
self::$_usedColors[$uid] = $class;
}
$class = "kint_{$class}";
return "
";
}
/**
* closes Kint::_wrapStart() started html tags and displays callee information
*
* @param array $callee caller information taken from debug backtrace
* @param array $prevCaller previous caller information taken from debug backtrace
*
* @return string
*/
protected static function _wrapEnd( $callee, $prevCaller )
{
if ( !Kint::$displayCalledFrom ) {
return '