classes/phing/filters/StripLineComments.php
public function read($len = null)
    {
        if (!$this->getInitialized()) {
            $this->_initialize();
            $this->setInitialized(true);
        }

        $buffer = $this->in->read($len);

        if ($buffer === -1) {
            return -1;
        }

        $lines = explode("\n", $buffer);
        $filtered = [];

        $commentsSize = count($this->_comments);

        foreach ($lines as $line) {
            for ($i = 0; $i < $commentsSize; $i++) {
                $comment = $this->_comments[$i]->getValue();
                if (StringHelper::startsWith($comment, ltrim($line))) {
                    $line = null;
                    break;
                }
            }
            if ($line !== null) {
                $filtered[] = $line;
            }
        }

        $filtered_buffer = implode("\n", $filtered);

        return $filtered_buffer;
    }
public function read($len = null)
    {
        if (!$this->getInitialized()) {
            $this->_initialize();
            $this->setInitialized(true);
        }

        $buffer = $this->in->read($len);

        if ($buffer === -1) {
            return -1;
        }

        $lines = explode("\n", $buffer);
        $filtered = [];

        $commentsSize = count($this->_comments);

        foreach ($lines as $line) {
            for ($i = 0; $i < $commentsSize; $i++) {
                $comment = $this->_comments[$i]->getValue();
                if (StringHelper::startsWith($comment, ltrim($line))) {
                    $line = null;
                    break;
                }
            }
            if ($line !== null) {
                $filtered[] = $line;
            }
        }

        $filtered_buffer = implode("\n", $filtered);

        return $filtered_buffer;
    }
public function read ( $ len = null ) { if ( ! $ this -> getInitialized ( ) ) { $ this -> _initialize ( ) ; $ this -> setInitialized ( true ) ; } $ buffer = $ this -> in -> read ( $ len ) ; if ( $ buffer === - 1 ) { return - 1 ; } $ lines = explode ( "\n" , $ buffer ) ; $ filtered = [ ] ; $ commentsSize = count ( $ this -> _comments ) ; foreach ( $ lines as $ line ) { for ( $ i = 0 ; $ i < $ commentsSize ; $ i ++ ) { $ comment = $ this -> _comments [ $ i ] -> getValue ( ) ; if ( StringHelper :: startsWith ( $ comment , ltrim ( $ line ) ) ) { $ line = null ; break ; } } if ( $ line !== null ) { $ filtered [ ] = $ line ; } } $ filtered_buffer = implode ( "\n" , $ filtered ) ; return $ filtered_buffer ; }
Returns stream only including
lines from the original stream which don't start with any of the
specified comment prefixes.

@param  null $len
@return mixed the resulting stream, or -1
if the end of the resulting stream has been reached.
Returns stream only including lines from the original stream which don t start with any of the specified comment prefixes .