original_string: protected function validateUploadFile()
      {
          $file = $this->request->file('file');
  
          if (empty($file)) {
              return null;
          }
  
          $result = $this->file_transfer->upload($file, null);
  
          if ($result !== true) {
              $this->setError('path', (string) $result);
              return false;
          }
  
          $this->setSubmitted('path', $this->file_transfer->getTransferred(true));
          return true;
      }
code: protected function validateUploadFile()
      {
          $file = $this->request->file('file');
  
          if (empty($file)) {
              return null;
          }
  
          $result = $this->file_transfer->upload($file, null);
  
          if ($result !== true) {
              $this->setError('path', (string) $result);
              return false;
          }
  
          $this->setSubmitted('path', $this->file_transfer->getTransferred(true));
          return true;
      }
code_tokens: protected function validateUploadFile ( ) { $ file = $ this -> request -> file ( 'file' ) ; if ( empty ( $ file ) ) { return null ; } $ result = $ this -> file_transfer -> upload ( $ file , null ) ; if ( $ result !== true ) { $ this -> setError ( 'path' , ( string ) $ result ) ; return false ; } $ this -> setSubmitted ( 'path' , $ this -> file_transfer -> getTransferred ( true ) ) ; return true ; }
docstring: Validates file upload
  @return bool|null
docstring_tokens: Validates file upload