/** * Remove the visibility modifier. */ protected function removeVisibility() { // Remove whitespace after visibility keyword. $this->visibility->next()->remove(); // Remove visibility keyword. $this->visibility->remove(); }
/** * @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; }
/** * @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; }
/** * @param boolean $is_final * @return $this */ public function setFinal($is_final) { if ($is_final) { if (!isset($this->final)) { $this->final = Token::_final(); $this->prepend([$this->final, Token::space()]); $this->setAbstract(FALSE); } } else { if (isset($this->final)) { // Remove whitespace. $this->final->next()->remove(); // Remove final. $this->final->remove(); } } return $this; }