public function getType($file, $default = self::DEFAULT_TYPE)
{
// Check only existing files
if (!is_file($file) || !is_readable($file)) {
return $default;
}
$ext = pathinfo($file, PATHINFO_EXTENSION);
$type = $this->tryStrategies($file);
if ($type) {
return $this->fixDetectionErrors($type, $ext);
}
if ($this->use_extension && isset($this->extensions[$ext])) {
return $this->extensions[$ext];
}
return $default;
}