Add type-safe wrapper around MD_STD
This commit is contained in:
parent
079786e42d
commit
790e332502
14
MD_STD.php
14
MD_STD.php
@ -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.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user