public function guess($binary)
    {
        $tmpFile = tempnam(sys_get_temp_dir(), 'ht-img-module');

        try {
            file_put_contents($tmpFile, $binary);

            $mimeType = $this->mimeTypeGuesser->guess($tmpFile);

            unlink($tmpFile);

            return $mimeType;
        } catch (\Exception $e) {
            unlink($tmpFile);

            throw $e;
        }
    }
public function guess($binary)
    {
        $tmpFile = tempnam(sys_get_temp_dir(), 'ht-img-module');

        try {
            file_put_contents($tmpFile, $binary);

            $mimeType = $this->mimeTypeGuesser->guess($tmpFile);

            unlink($tmpFile);

            return $mimeType;
        } catch (\Exception $e) {
            unlink($tmpFile);

            throw $e;
        }
    }
public function guess ( $ binary ) { $ tmpFile = tempnam ( sys_get_temp_dir ( ) , 'ht-img-module' ) ; try { file_put_contents ( $ tmpFile , $ binary ) ; $ mimeType = $ this -> mimeTypeGuesser -> guess ( $ tmpFile ) ; unlink ( $ tmpFile ) ; return $ mimeType ; } catch ( \ Exception $ e ) { unlink ( $ tmpFile ) ; throw $ e ; } }
Gets mime type of binary

@param  string     $binary
@return string
@throws \Exception
Gets mime type of binary