Пример #1
0
 /**
  * Set mime type for current file
  *
  * @param string $mime Mime type or file full path
  * @param bool $isPath
  * @return $this
  */
 public function setMime($mime, $isPath = false)
 {
     if ($isPath) {
         $this->mime->setMimeByPath($mime);
     } else {
         $this->mime->setMime($mime);
     }
     $this->file->mime = $this->mime->getFileType();
     $this->file->type = $this->mime->getMediaType();
     $this->file->mimetype = $this->mime->getMimeType();
     return $this;
 }
Пример #2
0
 /**
  * @param Mime $mime
  * @return string
  *
  * @throws BadConfigurationException
  */
 public function get(Mime $mime)
 {
     return $this->result($mime->getFileType());
 }