original_string: public function initializeMediaFromUploadedFile(UploadedFile $uploadedFile, $folderId, $siteId, $title = null)
      {
          /** @var MediaInterface $media */
          $media = new $this->mediaClass();
          $media->setSiteId($siteId);
          $media->setFile($uploadedFile);
          $media->setFilesystemName($uploadedFile->getFilename());
          $media->setMediaFolder($this->folderRepository->find($folderId));
          $media->setName($uploadedFile->getClientOriginalName());
          $media->setMimeType($uploadedFile->getMimeType());
          if (null === $title) {
              $title = $uploadedFile->getFilename();
          }
          foreach ($this->frontLanguages as $language) {
              $media->addTitle($language, $title);
          }
  
          return $media;
      }
code: public function initializeMediaFromUploadedFile(UploadedFile $uploadedFile, $folderId, $siteId, $title = null)
      {
          /** @var MediaInterface $media */
          $media = new $this->mediaClass();
          $media->setSiteId($siteId);
          $media->setFile($uploadedFile);
          $media->setFilesystemName($uploadedFile->getFilename());
          $media->setMediaFolder($this->folderRepository->find($folderId));
          $media->setName($uploadedFile->getClientOriginalName());
          $media->setMimeType($uploadedFile->getMimeType());
          if (null === $title) {
              $title = $uploadedFile->getFilename();
          }
          foreach ($this->frontLanguages as $language) {
              $media->addTitle($language, $title);
          }
  
          return $media;
      }
code_tokens: public function initializeMediaFromUploadedFile ( UploadedFile $ uploadedFile , $ folderId , $ siteId , $ title = null ) { /** @var MediaInterface $media */ $ media = new $ this -> mediaClass ( ) ; $ media -> setSiteId ( $ siteId ) ; $ media -> setFile ( $ uploadedFile ) ; $ media -> setFilesystemName ( $ uploadedFile -> getFilename ( ) ) ; $ media -> setMediaFolder ( $ this -> folderRepository -> find ( $ folderId ) ) ; $ media -> setName ( $ uploadedFile -> getClientOriginalName ( ) ) ; $ media -> setMimeType ( $ uploadedFile -> getMimeType ( ) ) ; if ( null === $ title ) { $ title = $ uploadedFile -> getFilename ( ) ; } foreach ( $ this -> frontLanguages as $ language ) { $ media -> addTitle ( $ language , $ title ) ; } return $ media ; }
docstring: initialize a media to fit an uploaded file
  
  @param UploadedFile $uploadedFile
  @param string       $folderId
  @param string       $siteId
  @param string|null  $title
  
  @return MediaInterface
docstring_tokens: initialize a media to fit an uploaded file