Fetches and returns the next line.

Returns false if end of file is reached.

@return array|bool
486062
public function fetch()
    {
        if (! $this->valid()) {
            return false;
        }
        $line = $this->current();
        $this->readLine();
        return $line;
    }
428949
public function getIterator()
    {
        if ($this->offset > 0) {
            $key   = null;
            $index = 0;
            //Skip the first N
            while (false !== ($record = $this->statement->fetch())) {
                if ($key === $record[ $this->pkField ]) {
                    continue;
                }
                $key = $record[ $this->pkField ];
                if ($index++ === $this->offset) {
                    break;
                }
            }
            $current = $record;
        } else {
            $current = $this->statement->fetch();
        }

        $currentKey = $current[ $this->pkField ];

        $fetchedRecordCount = 1;
        do {
            yield $currentKey => $current;

            $current = $this->statement->fetch();
            if (empty($current)) {
                break;
            }
            if ($currentKey !== $current[ $this->pkField ]) {
                $currentKey = $current[ $this->pkField ];
                $fetchedRecordCount++;
            }
        } while ($fetchedRecordCount <= $this->limit);

        $this->statement->closeCursor();
    }
466067
public function getNextLine()
    {
        $row = $this->nextRow;
        if ($row === null) {
            if (!$this->resource) {
                $this->open();
            }
            if ($this->isEof()) {
                throw new \Exception('EOF');
            }
            $row = $this->nextRow;
            if ($row === null) {
                throw new \Exception('cannot get valid row, but isEof returns false');
            }
        }
        $this->nextRow = null;
        $colNum = 0;
        $obj = [];
        if (count($row) != count($this->headerRow)) {
            throw new DataSourceException('Invalid row: '.implode(', ', $row));
        }
        foreach ($this->headerRow as $fieldName) {
            $obj[$fieldName] = $row[$colNum];
            ++$colNum;
        }

        return $obj;
    }
365812
public function fetchArray()
	{
		if( isset( $this->rows[$this->cursor] ) )
		{
			$row = $this->rows[$this->cursor];
			return $row->getPairs();
		}
		else return FALSE;
	}
804381
public function getNextLine()
    {
        if ( $this->currentMessagePosition === 0 )
        {
            $this->nextMail();
        }
        if ( $this->hasMoreMailData )
        {
            $data = fgets( $this->fh );
            if ( feof( $this->fh ) || substr( $data, 0, 5 ) === "From " )
            {
                $this->hasMoreMailData = false;

                return null;
            }
            return $data;
        }
        return null;
    }
212968
protected function getNextFusionLine()
    {
        $fusionLine = current($this->currentSourceCodeLines);
        next($this->currentSourceCodeLines);
        $this->currentLineNumber++;
        return $fusionLine;
    }
329506
public function getLine()
    {
        $line = @stream_get_line($this->sock, 2048, "\n");
        if ($line === '' || $line === false) {
            $line = $this->ioEmptyError() ? false : null;
        } else {
            $line = rtrim($line, "\r");
        }
        $this->ioFlagReset();
        return $line;
    }
708558
private function peekLine()
    {
        if ($this->filePeek == null) {
            $this->filePeek = fgets($this->fileHandle);
        }

        return $this->filePeek;
    }
281511
protected function getLine()
    {
        $pos = false;
        foreach ($this->eol as $eol) {
            $pos = strpos($this->incomingData, $eol);
            if ($pos !== false) {
                break;
            }
        }
        if ($pos === false) {
            return false;
        }

        $len    = strlen($eol);
        $line   = \Erebot\Utils::toUTF8(substr($this->incomingData, 0, $pos));
        $this->incomingData    = substr($this->incomingData, $pos + $len);
        $this->rcvQueue[]      = $line;

        $logger = \Plop\Plop::getInstance();
        $logger->debug(
            '%(line)s',
            array('line' => addcslashes($line, "\000..\037"))
        );
        return true;
    }
960041
protected function GetLine()
    {
        $sLine = fgets($this->fp, 2048 * 16);
        if (false === $sLine) {
            return $sLine;
        }
        // find out if the line contains an uneven number of '"'. if so, we assume, that the line contains a line break
        $sLine = trim($sLine);
        $aTmpParts = explode('"', $sLine);
        if (1 != (count($aTmpParts) % 2)) {
            // need to read until we find the first '"'...
            $bDone = false;
            do {
                $sTmpLine = fgets($this->fp, 2048 * 16);
                if (false === $sTmpLine) {
                    $bDone = true;
                } else {
                    $sTmpLine = trim($sTmpLine);
                    $sLine .= "\n".$sTmpLine;
                    $aTmpParts = explode('"', $sTmpLine);
                    if (1 != (count($aTmpParts) % 2)) {
                        $bDone = true;
                    }
                }
            } while (!$bDone);
        }
        $sLine = utf8_encode($sLine);
        $aParts = explode($this->sLineSplit, $sLine);

        // strip quotes
        foreach (array_keys($aParts) as $sIndex) {
            $aParts[$sIndex] = trim($aParts[$sIndex]);
            if ('"' == substr($aParts[$sIndex], 0, 1) && '"' == substr($aParts[$sIndex], -1)) {
                $aParts[$sIndex] = substr($aParts[$sIndex], 1, -1);
            }
        }
        reset($aParts);

        return $aParts;
    }
1055652
public function getNextRow()
        {
            if ($this->_next()) {
                $row = $this->getCurrentRow();
                if ($row instanceof Row) {
                    return $row;
                }
                throw new \Exception('This should never happen. Please file a bug report');
            } else {
                return false;
            }
        }
116962
public function next() {
		if ($this->currentRecord < count($this->rows)) {
			$row = $this->rows[$this->currentRecord];
			$this->currentRecord++;
			return $row;
		} else {
			return false;
		}
	}
654772
function nextRaw()
    {
        if ($this->type == self::SOURCE_FILE) {
            $record = stream_get_line($this->source, File_MARC::MAX_RECORD_LENGTH, File_MARC::END_OF_RECORD);

            // Remove illegal stuff that sometimes occurs between records
            $record = preg_replace('/^[\\x0a\\x0d\\x00]+/', "", $record);

        } elseif ($this->type == self::SOURCE_STRING) {
            $record = array_shift($this->source);
        }

        // Exit if we are at the end of the file
        if (!$record) {
            return false;
        }

        // Append the end of record we lost during stream_get_line() or explode()
        $record .= File_MARC::END_OF_RECORD;
        return $record;
    }
1254082
public function readLine()
    {
        $this->log->debug('going to read a line from the stream');
        $line = $this->streamReadLine($this->stream);

        if (false === $line) {
            $meta = $this->streamMeta($this->stream);
            $this->log->warning('fgets returned false', $meta);
            throw new StreamException(StreamException::OP_READ, 'stream_get_line returned false');
        }

        $this->log->debug('readLine()', [$line]);

        return $line;
    }
782135
public function getNextLine()
    {
        if ( $this->currentMessage === null )
        {
            // instead of calling $this->nextMail() in the constructor, it is called
            // here, to avoid sending commands to the server when creating the set, and
            // instead send the server commands when parsing the set (see ezcMailParser).
            $this->nextMail();
        }
        if ( $this->hasMoreMailData )
        {
            if ( $this->bytesToRead !== false && $this->bytesToRead >= 0 )
            {
                $data = $this->connection->getLine();
                $this->bytesToRead -= strlen( $data );

                // modified for issue #13878 (Endless loop in ezcMailParser):
                // removed wrong checks (ending in ')' check and ending with tag check (e.g. 'A0002'))
                if ( $this->bytesToRead <= 0 )
                {
                    if ( $this->bytesToRead < 0 )
                    {
                        $data = substr( $data, 0, strlen( $data ) + $this->bytesToRead ); //trim( $data, ")\r\n" );
                    }

                    if ( $this->bytesToRead === 0 )
                    {
                        // hack for Microsoft Exchange, which sometimes puts
                        // FLAGS (\Seen)) at the end of a message instead of before (!)
                        if ( strlen( trim( $data, ")\r\n" ) !== strlen( $data ) - 3 ) )
                        {
                            // if the last line in a mail does not end with ")\r\n"
                            // then read an extra line and discard it
                            $extraData = $this->connection->getLine();
                        }
                    }

                    $this->hasMoreMailData = false;
                    // remove the mail if required by the user.
                    if ( $this->deleteFromServer === true )
                    {
                        $tag = $this->getNextTag();
                        $this->connection->sendData( "{$tag} {$this->uid}STORE {$this->currentMessage} +FLAGS (\\Deleted)" );
                        // skip OK response ("{$tag} OK Store completed.")
                        $response = $this->getResponse( $tag );
                    }
                    return $data;
                }
            }
            return $data;
        }
        return null;
    }
649060
public function nextLine()
    {
        $value = $this->getConnection()->_get_channel_packet(SSH2::CHANNEL_EXEC);

        return $value === true ? null : $value;
    }
608331
public function getNextLine()
    {
        if ( $this->hasMoreMailData === false )
        {
            $this->nextMail();
        }
        // finished?
        if ( $this->fp == null || feof( $this->fp ) )
        {
            if ( $this->fp != null )
            {
                fclose( $this->fp );
                $this->fp = null;
            }
            return null;
        }

        // get one line
        $next = fgets( $this->fp );
        if ( $next == "" && feof( $this->fp ) )
        {
            return null;
        }
        return $next;
    }