Zend\Code\Generator\ValueGenerator::setOutputMode PHP Method

setOutputMode() public method

public setOutputMode ( string $outputMode ) : ValueGenerator
$outputMode string
return ValueGenerator
    public function setOutputMode($outputMode)
    {
        $this->outputMode = (string) $outputMode;
        return $this;
    }

Usage Example

コード例 #1
0
 /**
  * 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;
 }
All Usage Examples Of Zend\Code\Generator\ValueGenerator::setOutputMode