Zend\Code\Generator\TypeGenerator::generate PHP Method

generate() public method

{@inheritDoc}
public generate ( )
    public function generate()
    {
        $nullable = $this->nullable ? '?' : '';
        if ($this->isInternalPhpType) {
            return $nullable . strtolower($this->type);
        }
        return $nullable . '\\' . $this->type;
    }

Usage Example

 /**
  * @param string|null $type
  *
  * @return string
  */
 private function generateTypeHint()
 {
     if (null === $this->type) {
         return '';
     }
     return $this->type->generate() . ' ';
 }
All Usage Examples Of Zend\Code\Generator\TypeGenerator::generate