protected function _dumpDefaultValue()
 {
     if (null === $this->_defaultValue) {
         return 'null';
     }
     $value = new ValueBlock($this->_defaultValue);
     return $value->dump();
 }
 /**
  * @return string
  */
 protected function _dumpValue()
 {
     $content = $this->_visibility . ' $' . $this->_name;
     if (null !== $this->_defaultValue) {
         $value = new ValueBlock($this->_defaultValue);
         $content .= ' = ' . $value->dump();
     }
     $content .= ';';
     return $content;
 }
Esempio n. 3
0
 /**
  * @return string
  */
 public function dump()
 {
     $entries = array();
     $isAssociative = $this->isAssociative();
     foreach ($this->_value as $key => $value) {
         $line = '';
         if ($isAssociative) {
             $line .= $key . ' => ';
         }
         $value = new ValueBlock($value);
         $line .= $value->dump();
         $entries[] = $line;
     }
     $content = implode(', ', $entries);
     if (strlen($content) < 100) {
         return 'array(' . $content . ')';
     } else {
         $content = implode(",\n", $entries);
         return $this->_dumpLine('array(', $this->_indent($content), ')');
     }
 }