src/Util.php
/**
     * Cleans or flushes output buffers up to target level.
     *
     * Resulting level can be greater than target level if a non-removable buffer has been encountered.
     *
     * @param int  $maxBufferLevel The target output buffering level
     * @param bool $flush          Whether to flush or clean the buffers
     *
     * @return void
     */
Cleans or flushes output buffers up to target level.
Resulting level can be greater than target level if a non-removable buffer has been encountered.

@param int  $maxBufferLevel The target output buffering level
@param bool $flush          Whether to flush or clean the buffers

@return void
Cleans or flushes output buffers up to target level . Resulting level can be greater than target level if a non - removable buffer has been encountered . @param int $maxBufferLevel The target output buffering level @param bool $flush Whether to flush or clean the buffers @return void
public static function closeOutputBuffers(int $maxBufferLevel, bool $flush): void
    {
        $status = \ob_get_status(true);
        $level  = \count($status);
        $flags  = \PHP_OUTPUT_HANDLER_REMOVABLE | ($flush ? \PHP_OUTPUT_HANDLER_FLUSHABLE : \PHP_OUTPUT_HANDLER_CLEANABLE);
        while ($level-- > $maxBufferLevel && ($s = $status[$level]) && (! isset($s['del']) ? ! isset($s['flags']) || $flags === ($s['flags'] & $flags) : $s['del'])) {
            if ($flush) {
                \ob_end_flush();
            } else {
                \ob_end_clean();
            }
        }
    }
public static function closeOutputBuffers ( int $ maxBufferLevel , bool $ flush ) : void { $ status = \ ob_get_status ( true ) ; $ level = \ count ( $ status ) ; $ flags = \ PHP_OUTPUT_HANDLER_REMOVABLE | ( $ flush ? \ PHP_OUTPUT_HANDLER_FLUSHABLE : \ PHP_OUTPUT_HANDLER_CLEANABLE ) ; while ( $ level -- > $ maxBufferLevel && ( $ s = $ status [ $ level ] ) && ( ! isset ( $ s [ 'del' ] ) ? ! isset ( $ s [ 'flags' ] ) || $ flags === ( $ s [ 'flags' ] & $ flags ) : $ s [ 'del' ] ) ) { if ( $ flush ) { \ ob_end_flush ( ) ; } else { \ ob_end_clean ( ) ; } } }
Cleans or flushes output buffers up to target level.
Cleans or flushes output buffers up to target level .