StripLineBreaks::read PHP Method

read() public method

Returns the filtered stream, only including characters not in the set of line-breaking characters.
public read ( $len = null ) : mixed
return mixed the resulting stream, or -1 if the end of the resulting stream has been reached.
    function read($len = null)
    {
        if (!$this->getInitialized()) {
            $this->_initialize();
            $this->setInitialized(true);
        }
        $buffer = $this->in->read($len);
        if ($buffer === -1) {
            return -1;
        }
        $buffer = preg_replace("/[" . $this->_lineBreaks . "]/", '', $buffer);
        return $buffer;
    }