original_string: public function addAction(Action $action): Editbox
      {
  
          switch ($action->getType()) {
              case Action::SAVE:
                  $this->actions[0] = $action;
                  break;
  
              case Action::CANCEL:
                  $this->actions[1] = $action;
                  break;
  
              case Action::CONTEXT:
              default:
                  if (empty($this->actions[2])) {
                      $this->actions[2] = [];
                  }
  
                  $this->actions[2][] = $action;
  
                  break;
  
          }
  
          return $this;
      }
code: public function addAction(Action $action): Editbox
      {
  
          switch ($action->getType()) {
              case Action::SAVE:
                  $this->actions[0] = $action;
                  break;
  
              case Action::CANCEL:
                  $this->actions[1] = $action;
                  break;
  
              case Action::CONTEXT:
              default:
                  if (empty($this->actions[2])) {
                      $this->actions[2] = [];
                  }
  
                  $this->actions[2][] = $action;
  
                  break;
  
          }
  
          return $this;
      }
code_tokens: public function addAction ( Action $ action ) : Editbox { switch ( $ action -> getType ( ) ) { case Action :: SAVE : $ this -> actions [ 0 ] = $ action ; break ; case Action :: CANCEL : $ this -> actions [ 1 ] = $ action ; break ; case Action :: CONTEXT : default : if ( empty ( $ this -> actions [ 2 ] ) ) { $ this -> actions [ 2 ] = [ ] ; } $ this -> actions [ 2 ] [ ] = $ action ; break ; } return $ this ; }
docstring: Adds an action link to actions list
  
  @param Action $action
  
  @return Editbox
docstring_tokens: Adds an action link to actions list