Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7414926
Position.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
Position.php
View Options
<?php
/**
* This file is part of the Peast package
*
* (c) Marco Marchiò <marco.mm89@gmail.com>
*
* For the full copyright and license information refer to the LICENSE file
* distributed with this source code
*/
namespace
Peast\Syntax
;
/**
* This class represents the position in the source code.
*
* @author Marco Marchiò <marco.mm89@gmail.com>
*/
class
Position
implements
\JSONSerializable
{
/**
* Source line
*
* @var int
*/
protected
$line
;
/**
* Source column
*
* @var int
*/
protected
$column
;
/**
* Source index
*
* @var int
*/
protected
$index
;
/**
* Class constructor
*
* @param int $line Source line
* @param int $column Source column
* @param int $index Source index
*/
function
__construct
(
$line
,
$column
,
$index
)
{
$this
->
line
=
$line
;
$this
->
column
=
$column
;
$this
->
index
=
$index
;
}
/**
* Returns the source line
*
* @return int
*/
public
function
getLine
()
{
return
$this
->
line
;
}
/**
* Returns the source column
*
* @return int
*/
public
function
getColumn
()
{
return
$this
->
column
;
}
/**
* Returns the source index
*
* @return int
*/
public
function
getIndex
()
{
return
$this
->
index
;
}
/**
* Returns a serializable version of the object
*
* @return array
*/
#[\ReturnTypeWillChange]
public
function
jsonSerialize
()
{
return
array
(
"line"
=>
$this
->
getLine
(),
"column"
=>
$this
->
getColumn
(),
"index"
=>
$this
->
getIndex
()
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 01:54 (1 d, 14 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ba/2d/3691e5fa7b41944c8536c218cd39
Default Alt Text
Position.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment