graphql-php/src/Language/SourceLocation.php
2018-08-20 20:26:21 +02:00

52 lines
817 B
PHP

<?php
declare(strict_types=1);
namespace GraphQL\Language;
class SourceLocation implements \JsonSerializable
{
/** @var int */
public $line;
/** @var int */
public $column;
/**
* @param int $line
* @param int $col
*/
public function __construct($line, $col)
{
$this->line = $line;
$this->column = $col;
}
/**
* @return int[]
*/
public function toArray()
{
return [
'line' => $this->line,
'column' => $this->column,
];
}
/**
* @return int[]
*/
public function toSerializableArray()
{
return $this->toArray();
}
/**
* @return int[]
*/
public function jsonSerialize()
{
return $this->toSerializableArray();
}
}