src/Util/StreamFilter.php
public static function append($stream, $callback, $read_write = STREAM_FILTER_ALL)
    {
        $ret = @\stream_filter_append($stream, self::register(), $read_write, $callback);
        if ($ret === false) {
            $error = \error_get_last() + ['message' => ''];
            throw new \RuntimeException('Unable to append filter: ' . $error['message']);
        }

        return $ret;
    }
public static function append($stream, $callback, $read_write = STREAM_FILTER_ALL)
    {
        $ret = @\stream_filter_append($stream, self::register(), $read_write, $callback);
        if ($ret === false) {
            $error = \error_get_last() + ['message' => ''];
            throw new \RuntimeException('Unable to append filter: ' . $error['message']);
        }

        return $ret;
    }
public static function append ( $ stream , $ callback , $ read_write = STREAM_FILTER_ALL ) { $ ret = @ \ stream_filter_append ( $ stream , self :: register ( ) , $ read_write , $ callback ) ; if ( $ ret === false ) { $ error = \ error_get_last ( ) + [ 'message' => '' ] ; throw new \ RuntimeException ( 'Unable to append filter: ' . $ error [ 'message' ] ) ; } return $ ret ; }
append a callback filter to the given stream

@param resource $stream
@param callable $callback
@param int      $read_write

@return resource filter resource which can be used for `remove()`
@throws \RuntimeException on error
@uses stream_filter_append()
append a callback filter to the given stream