Nette\PhpGenerator\Method::setName PHP Method

setName() public method

Deprecation:
public setName ( $name )
    public function setName($name)
    {
        $this->name = $name ? (string) $name : NULL;
        return $this;
    }

Usage Example

Example #1
0
 /**
  * @param  string
  * @return Method
  */
 public function addMethod($name)
 {
     $method = new Method();
     if ($this->type === 'interface') {
         $method->setVisibility(NULL)->setBody(FALSE);
     } else {
         $method->setVisibility('public');
     }
     return $this->methods[$name] = $method->setName($name);
 }