public function getMimetype() { $finfo = new \finfo(FILEINFO_MIME); if (!$this->exists()) { throw new \LogicException(sprintf('Path "%s" does not exist.', $this->path ?: '*none*')); } return $finfo->file($this->path); }