mirror of
https://github.com/retailcrm/graphql-php.git
synced 2025-03-21 07:23:48 +03:00
52 lines
817 B
PHP
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();
|
|
}
|
|
}
|