Example #1
0
 /**
  * Get file extension
  *
  * @return string
  */
 public function getExtension()
 {
     if ($this->extension === null) {
         $hit = Mimetypes::getExtensionForMimetype($this->getMimetype());
         $this->extension = $hit ? $hit : parent::getExtension();
     }
     return $this->extension;
 }
Example #2
0
 /**
  * Return the mimetype of the file.
  *
  * @return string
  */
 public function getMimetype()
 {
     return Mimetypes::getInstance()->fromFilename($this->path) ?: 'text/plain';
 }