X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FReversedFileReader.php;h=58fb2cb3faaceab460c86ed8192cb103625725fe;hb=d4a5a8051ad34a7be72238967afb3e6b140afdc8;hp=cda78ad0abb0b76037f6cfccf22eb308de262ef5;hpb=8b7cb5d9efeab580c2592e0fbe301f7142b73a3d;p=friendica.git diff --git a/src/Util/ReversedFileReader.php b/src/Util/ReversedFileReader.php index cda78ad0ab..58fb2cb3fa 100644 --- a/src/Util/ReversedFileReader.php +++ b/src/Util/ReversedFileReader.php @@ -1,6 +1,6 @@ fh = fopen($filename, 'r'); if (!$this->fh) { // this should use a custom exception. - throw \Exception("Unable to open $filename"); + throw new \Exception("Unable to open $filename"); } $this->filesize = filesize($filename); $this->pos = -1; @@ -89,7 +89,7 @@ class ReversedFileReader implements \Iterator * * @return string|null Depending on data being buffered */ - private function _readline() + private function _readline(): ?string { $buffer = & $this->buffer; while (true) { @@ -112,6 +112,7 @@ class ReversedFileReader implements \Iterator * @see Iterator::next() * @return void */ + #[\ReturnTypeWillChange] public function next() { ++$this->key; @@ -124,6 +125,7 @@ class ReversedFileReader implements \Iterator * @see Iterator::rewind() * @return void */ + #[\ReturnTypeWillChange] public function rewind() { if ($this->filesize > 0) { @@ -158,7 +160,7 @@ class ReversedFileReader implements \Iterator } /** - * Checks if current iterator value is valid, that is, we readed all lines in files + * Checks if current iterator value is valid, that is, we read all lines in files * * @see Iterator::valid() * @return bool