original_string: protected function validateUpload(UploadedFileInterface $file): void
      {
          // Handle bad filenames.
          $filename = $file->getClientFilename();
  
          if (!Utils::checkFilename($filename)) {
              $grav = Grav::instance();
              throw new \RuntimeException(
                  sprintf($grav['language']->translate('PLUGIN_FORM.FILEUPLOAD_UNABLE_TO_UPLOAD', null, true), $filename, 'Bad filename')
              );
          }
      }
code: protected function validateUpload(UploadedFileInterface $file): void
      {
          // Handle bad filenames.
          $filename = $file->getClientFilename();
  
          if (!Utils::checkFilename($filename)) {
              $grav = Grav::instance();
              throw new \RuntimeException(
                  sprintf($grav['language']->translate('PLUGIN_FORM.FILEUPLOAD_UNABLE_TO_UPLOAD', null, true), $filename, 'Bad filename')
              );
          }
      }
code_tokens: protected function validateUpload ( UploadedFileInterface $ file ) : void { // Handle bad filenames. $ filename = $ file -> getClientFilename ( ) ; if ( ! Utils :: checkFilename ( $ filename ) ) { $ grav = Grav :: instance ( ) ; throw new \ RuntimeException ( sprintf ( $ grav [ 'language' ] -> translate ( 'PLUGIN_FORM.FILEUPLOAD_UNABLE_TO_UPLOAD' , null , true ) , $ filename , 'Bad filename' ) ) ; } }
docstring: Validate uploaded file.
  
  @param UploadedFileInterface $file
docstring_tokens: Validate uploaded file .