Exemple #1
0
 public static function renderHeader(Kint_Object $o)
 {
     $output = '';
     if (($s = $o->getModifiers()) !== null) {
         $output .= '<var>' . $s . '</var> ';
     }
     if (($s = $o->getName()) !== null) {
         $output .= '<dfn>' . Kint_Object_Blob::escape($s) . '</dfn> ';
         if ($s = $o->getOperator()) {
             $output .= Kint_Object_Blob::escape($s) . ' ';
         }
     }
     if (($s = $o->getType()) !== null) {
         $output .= '<var>' . Kint_Object_Blob::escape($s) . '</var>';
     }
     if (($s = $o->getSize()) !== null) {
         $output .= '(' . $s . ') ';
     }
     if (($s = $o->getValueShort()) !== null) {
         $s = preg_replace('/\\s+/', ' ', $s);
         if (Kint::$max_str_length && Kint_Object_Blob::strlen($s) > Kint::$max_str_length) {
             $s = substr($s, 0, Kint::$max_str_length) . '...';
         }
         $output .= Kint_Object_Blob::escape($s);
     }
     return $output;
 }
Exemple #2
0
 public function getValueShort()
 {
     if (!$this->value || !$this->value instanceof Kint_Object_Representation_Docstring) {
         return parent::getValueShort();
     }
     $string = array();
     $lines = explode("\n", $this->value->docstringWithoutComments());
     foreach ($lines as $line) {
         if (Kint_Object_Blob::strlen($line) === 0) {
             break;
         }
         $string[] = $line;
     }
     return implode(' ', $string);
 }