public static function getMediaTypeFromFileContent(string $fileContent): string
    {
        $fileInfo = new \finfo(FILEINFO_MIME);
        $mediaType = self::trimMediaType($fileInfo->buffer($fileContent));
        return isset(self::$mediaTypeToFileExtension[$mediaType]) ? $mediaType : 'application/octet-stream';
    }
public static function getMediaTypeFromFileContent(string $fileContent): string
    {
        $fileInfo = new \finfo(FILEINFO_MIME);
        $mediaType = self::trimMediaType($fileInfo->buffer($fileContent));
        return isset(self::$mediaTypeToFileExtension[$mediaType]) ? $mediaType : 'application/octet-stream';
    }
public static function getMediaTypeFromFileContent ( string $ fileContent ) : string { $ fileInfo = new \ finfo ( FILEINFO_MIME ) ; $ mediaType = self :: trimMediaType ( $ fileInfo -> buffer ( $ fileContent ) ) ; return isset ( self :: $ mediaTypeToFileExtension [ $ mediaType ] ) ? $ mediaType : 'application/octet-stream' ; }
Returns a Media Type based on the file content

@param string $fileContent The file content do determine the media type from
@return string The IANA Internet Media Type
Returns a Media Type based on the file content