<?php
/**
- * @copyright Copyright (C) 2021, Friendica
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
/**
* Read $size bytes behind last position
- *
+ *
* @return string
*/
private function _read($size)
/**
* Read next line from end of file
* Return null if no lines are left to read
- *
+ *
* @return ?string
*/
private function _readline()
if ($this->pos == 0) {
return array_pop($buffer);
}
+ if (is_null($buffer)) {
+ return null;
+ }
if (count($buffer) > 1) {
return array_pop($buffer);
}
/**
* Fetch next line from end and set it as current iterator value.
- *
+ *
* @see Iterator::next()
* @return void
*/
/**
* Rewind iterator to the first line at the end of file
- *
+ *
* @see Iterator::rewind()
- * @return void
+ * @return void
*/
public function rewind()
{
/**
* Return current line number, starting from zero at the end of file
- *
+ *
* @see Iterator::key()
* @return int
*/
/**
* Return current line
- *
+ *
* @see Iterator::current()
* @return string
*/
/**
* Checks if current iterator value is valid, that is, we readed all lines in files
- *
+ *
* @see Iterator::valid()
* @return bool
*/