/**
* generate()
*
* @return string
*/
public function generate()
{
$output = '';
if ($this->type && !in_array($this->type, self::$simple)) {
$output .= $this->type . ' ';
}
if ($this->passedByReference === true) {
$output .= '&';
}
$output .= '$' . $this->name;
if ($this->defaultValue !== null) {
$output .= ' = ';
if (is_string($this->defaultValue)) {
$output .= ValueGenerator::escape($this->defaultValue);
} else {
if ($this->defaultValue instanceof ValueGenerator) {
$this->defaultValue->setOutputMode(ValueGenerator::OUTPUT_SINGLE_LINE);
$output .= (string) $this->defaultValue;
} else {
$output .= $this->defaultValue;
}
}
}
return $output;
}