Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
web
/
vhosts
/
716cf56cb2.url-de-test.ws
/
htdocs
/
vendor
/
doctrine
/
sql-formatter
/
src
/
/srv/data/web/vhosts/716cf56cb2.url-de-test.ws/htdocs/vendor/doctrine/sql-formatter/src/Cursor.php
<?php declare(strict_types=1); namespace Doctrine\SqlFormatter; final class Cursor { /** @var int */ private $position = -1; /** @var Token[] */ private $tokens; /** * @param Token[] $tokens */ public function __construct(array $tokens) { $this->tokens = $tokens; } public function next(?int $exceptTokenType = null): ?Token { while ($token = $this->tokens[++$this->position] ?? null) { if ($exceptTokenType !== null && $token->isOfType($exceptTokenType)) { continue; } return $token; } return null; } public function previous(?int $exceptTokenType = null): ?Token { while ($token = $this->tokens[--$this->position] ?? null) { if ($exceptTokenType !== null && $token->isOfType($exceptTokenType)) { continue; } return $token; } return null; } public function subCursor(): self { $cursor = new self($this->tokens); $cursor->position = $this->position; return $cursor; } }