' . $randomBufferClassCallbackCode); $randomBufferClassCallbackContents = ob_get_contents(); ob_end_clean(); return $randomBufferClassCallbackContents; } /** * Buffer file * * @param string $randomBufferClassPagePath * @param array $randomBufferClassDataVariable * * @return string */ public static function file(string $randomBufferClassPagePath, ?array $randomBufferClassDataVariable = NULL) : string { if( ! is_file($randomBufferClassPagePath) ) { throw new InvalidArgumentException('Error', 'fileParameter', '1.($file)'); } if( is_array($randomBufferClassDataVariable) ) { extract($randomBufferClassDataVariable, EXTR_OVERWRITE, 'ZN'); } ob_start(); require $randomBufferClassPagePath; $randomBufferClassPageContents = ob_get_contents(); ob_end_clean(); return $randomBufferClassPageContents; } }