/**
  * @param boolean $is_static
  *
  * @return $this
  */
 public function setStatic($is_static)
 {
     if ($is_static) {
         if (!isset($this->static)) {
             $this->static = Token::_static();
             $this->visibility->after([Token::space(), $this->static]);
         }
     } else {
         if (isset($this->static)) {
             // Remove whitespace after static keyword.
             $this->static->next()->remove();
             // Remove static keyword.
             $this->static->remove();
         }
     }
     return $this;
 }
Exemple #2
0
 /**
  * @param boolean $is_static
  * @return $this
  */
 public function setStatic($is_static)
 {
     if ($is_static) {
         if (!isset($this->static)) {
             // Insert before T_FUNCTION.
             $function_token = $this->name->previous()->previous();
             $this->static = Token::_static();
             $function_token->before([$this->static, Token::space()]);
         }
     } else {
         if (isset($this->static)) {
             // Remove whitespace after static keyword.
             $this->static->next()->remove();
             // Remove static keyword.
             $this->static->remove();
         }
     }
     return $this;
 }