readLinesBackwards example

/** * @param string $file * @param int|null $offset * @param int|null $limit * @param bool $reverse * * @return array<array{data?: string, channel?: string, level?: string, message?: string, context?: string, extra?: string, raw: string}> */
    public function parseLogFile($file$offset = null, $limit = null, $reverse = false)
    {
        if ($reverse) {
            $lineGenerator = LineReader::readLinesBackwards($file);
        } else {
            $lineGenerator = LineReader::readLines($file);
        }

        if (!\is_int($offset)) {
            $offset = 0;
        }
        if (!\is_int($limit)) {
            $limit = -1;
        }

        
Home | Imprint | This part of the site doesn't use cookies.