original_string: public function buildValue()
      {
          $actions = [
              'add' => [],
              'replace' => [],
              'remove' => [],
          ];
  
          foreach ($this->actions as $action) {
              switch ($action->getName()) {
                  case 'add':
                      $actions['add'][] = [$action->getArgument(0)];
                      break;
                  case 'replace':
                      $actions['replace'][] = [$action->getArgument(0), $action->getArgument(1)];
                      break;
                  case 'remove':
                      $actions['remove'][] = [$action->getArgument(0)];
                      break;
              }
          }
  
          $builder = $this->getBuilder();
  
          foreach ($actions as $action => $calls) {
              foreach ($calls as $arguments) {
                  call_user_func_array([$builder, $action], $arguments);
              }
          }
  
          return $builder->get();
      }
code: public function buildValue()
      {
          $actions = [
              'add' => [],
              'replace' => [],
              'remove' => [],
          ];
  
          foreach ($this->actions as $action) {
              switch ($action->getName()) {
                  case 'add':
                      $actions['add'][] = [$action->getArgument(0)];
                      break;
                  case 'replace':
                      $actions['replace'][] = [$action->getArgument(0), $action->getArgument(1)];
                      break;
                  case 'remove':
                      $actions['remove'][] = [$action->getArgument(0)];
                      break;
              }
          }
  
          $builder = $this->getBuilder();
  
          foreach ($actions as $action => $calls) {
              foreach ($calls as $arguments) {
                  call_user_func_array([$builder, $action], $arguments);
              }
          }
  
          return $builder->get();
      }
code_tokens: public function buildValue ( ) { $ actions = [ 'add' => [ ] , 'replace' => [ ] , 'remove' => [ ] , ] ; foreach ( $ this -> actions as $ action ) { switch ( $ action -> getName ( ) ) { case 'add' : $ actions [ 'add' ] [ ] = [ $ action -> getArgument ( 0 ) ] ; break ; case 'replace' : $ actions [ 'replace' ] [ ] = [ $ action -> getArgument ( 0 ) , $ action -> getArgument ( 1 ) ] ; break ; case 'remove' : $ actions [ 'remove' ] [ ] = [ $ action -> getArgument ( 0 ) ] ; break ; } } $ builder = $ this -> getBuilder ( ) ; foreach ( $ actions as $ action => $ calls ) { foreach ( $ calls as $ arguments ) { call_user_func_array ( [ $ builder , $ action ] , $ arguments ) ; } } return $ builder -> get ( ) ; }
docstring: Builds a block option value using the given builder
  
  @return mixed The built value
docstring_tokens: Builds a block option value using the given builder