Ejemplo n.º 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();
 }
Ejemplo n.º 2
0
Archivo: File.php Proyecto: bengor/file
 /**
  * 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;
 }