src/Common/Service/Mime.php
public function detectFromFile(string $sFile): string
    {
        if (!file_exists($sFile)) {
            return '';
        }

        $rHandle = finfo_open(FILEINFO_MIME_TYPE);
        $sMime   = finfo_file($rHandle, $sFile);

        if ($sMime === 'application/octet-stream' || empty($sMime)) {
            $sMime = $this->oDetector->getType($sFile);
        }

        return $sMime ?? 'application/octet-stream';
    }
public function detectFromFile(string $sFile): string
    {
        if (!file_exists($sFile)) {
            return '';
        }

        $rHandle = finfo_open(FILEINFO_MIME_TYPE);
        $sMime   = finfo_file($rHandle, $sFile);

        if ($sMime === 'application/octet-stream' || empty($sMime)) {
            $sMime = $this->oDetector->getType($sFile);
        }

        return $sMime ?? 'application/octet-stream';
    }
public function detectFromFile ( string $ sFile ) : string { if ( ! file_exists ( $ sFile ) ) { return '' ; } $ rHandle = finfo_open ( FILEINFO_MIME_TYPE ) ; $ sMime = finfo_file ( $ rHandle , $ sFile ) ; if ( $ sMime === 'application/octet-stream' || empty ( $ sMime ) ) { $ sMime = $ this -> oDetector -> getType ( $ sFile ) ; } return $ sMime ?? 'application/octet-stream' ; }
Detect a file's mimetype, first using the system, followed by the detector

@param string $sFile The path to the file to detect

@return string
@throws \Exception
Detect a file s mimetype first using the system followed by the detector