/** * @param KintVariableData $kintVar * @param bool $verbose * * @return string */ private static function _drawHeader(KintVariableData $kintVar, $verbose = true) { $output = ''; if ($verbose) { if ($kintVar->access !== null) { $output .= '<var>' . $kintVar->access . '</var> '; } if ($kintVar->name !== null && $kintVar->name !== '') { $output .= '<dfn>' . KintParser::escape($kintVar->name) . '</dfn> '; } if ($kintVar->operator !== null) { $output .= $kintVar->operator . ' '; } } if ($kintVar->type !== null) { if ($verbose) { $output .= '<var>'; } $output .= $kintVar->type; if ($verbose) { $output .= '</var>'; } else { $output .= ' '; } } if ($kintVar->size !== null) { $output .= '(' . $kintVar->size . ') '; } return $output; }
/** * @param string $text * * @return string */ private static function _title($text) { $escaped = KintParser::escape($text); $lengthDifference = strlen($escaped) - strlen($text); return self::_colorize(self::_char('┌') . self::_char('─', self::$_consoleRow - 2) . self::_char('┐') . PHP_EOL . self::_char('│'), 'title', false) . self::_colorize(str_pad($escaped, self::$_consoleRow - 2 + $lengthDifference, ' ', STR_PAD_BOTH), 'title', false) . self::_colorize(self::_char('│') . PHP_EOL . self::_char('└') . self::_char('─', self::$_consoleRow - 2) . self::_char('┘'), 'title'); }