Add type-safe wrapper around MD_STD

This commit is contained in:
Joshua Ramon Enslin 2020-08-05 15:31:29 +02:00 committed by Stefan Rohde-Enslin
parent 079786e42d
commit 790e332502

View File

@ -67,6 +67,20 @@ class MD_STD {
}
/**
* Type safe wrapper around ob_get_clean(): Gets the current buffer
* contents and delete current output buffer.
*
* @return string
*/
public static function ob_get_clean():string {
$output = ob_get_clean();
if ($output === false) throw new MDOutputBufferNotStarted("Output buffer was not started");
return $output;
}
/**
* Function checking if a string starts with another.
*