class Position
This class represents the position in the source code.
@author Marco Marchiò <marco.mm89@gmail.com>
Hierarchy
- class \Peast\Syntax\Position implements \Peast\Syntax\JSONSerializable
Expanded class hierarchy of Position
4 string references to 'Position'
- Attachment::buildOptionsForm in core/
modules/ views/ src/ Plugin/ views/ display/ Attachment.php - Provide the default form for setting options.
- PlaceBlock::apply in core/
modules/ block/ src/ Plugin/ ConfigAction/ PlaceBlock.php - Applies the config action.
- Token::offsetExists in vendor/
doctrine/ lexer/ src/ Token.php - views.schema.yml in core/
modules/ views/ config/ schema/ views.schema.yml - core/modules/views/config/schema/views.schema.yml
File
-
vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Position.php, line 17
Namespace
Peast\SyntaxView source
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
*/
public function jsonSerialize() {
return array(
"line" => $this->getLine(),
"column" => $this->getColumn(),
"index" => $this->getIndex(),
);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
Position::$column | protected | property | Source column |
Position::$index | protected | property | Source index |
Position::$line | protected | property | Source line |
Position::getColumn | public | function | Returns the source column |
Position::getIndex | public | function | Returns the source index |
Position::getLine | public | function | Returns the source line |
Position::jsonSerialize | public | function | Returns a serializable version of the object |
Position::__construct | function | Class constructor |