original_string: public function onPreSubmit(FormEvent $event)
      {
          $data = $event->getData();
  
          if ($data['file'] instanceof UploadedFile) {
              $event->getForm()->remove('remove');
          }
  
          if (empty($data['file']) && (!isset($data['remove']) || !$data['remove'])) {
              $event->setData($event->getForm()->getViewData());
          }
      }
code: public function onPreSubmit(FormEvent $event)
      {
          $data = $event->getData();
  
          if ($data['file'] instanceof UploadedFile) {
              $event->getForm()->remove('remove');
          }
  
          if (empty($data['file']) && (!isset($data['remove']) || !$data['remove'])) {
              $event->setData($event->getForm()->getViewData());
          }
      }
code_tokens: public function onPreSubmit ( FormEvent $ event ) { $ data = $ event -> getData ( ) ; if ( $ data [ 'file' ] instanceof UploadedFile ) { $ event -> getForm ( ) -> remove ( 'remove' ) ; } if ( empty ( $ data [ 'file' ] ) && ( ! isset ( $ data [ 'remove' ] ) || ! $ data [ 'remove' ] ) ) { $ event -> setData ( $ event -> getForm ( ) -> getViewData ( ) ) ; } }
docstring: Forbids to erase a value
  
  @param FormEvent $event
docstring_tokens: Forbids to erase a value