Beispiel #1
0
 /**
  * Method that checks if the mime type given is equal to the current.
  *
  * @param FileMimeType $aMimeType The mime type
  *
  * @return bool
  */
 public function equals(FileMimeType $aMimeType)
 {
     return $this->mimeType() === $aMimeType->mimeType();
 }
Beispiel #2
0
 /**
  * Sets the given mime type in the file scope.
  *
  * @param FileMimeType $aMimeType The mime type
  *
  * @throws FileMimeTypeDoesNotSupportException when the given mime type is not support for the file
  */
 private function setMimeType(FileMimeType $aMimeType)
 {
     if (!in_array($aMimeType->mimeType(), $this->availableMimeTypes(), true)) {
         throw new FileMimeTypeDoesNotSupportException();
     }
     $this->mimeType = $aMimeType;
 }