Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4153521
Cursor.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
Cursor.php
View Options
<?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
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 19 2026, 20:46 (7 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
03/1d/00e824f9be77a1a70aed6b97ca5a
Default Alt Text
Cursor.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment