Version 4.6.0

This commit is contained in:
Neo committed 2025-12-19 05:55:31 -08:00
1 parent f79dcf067a
commit 517a5e1f70
2036 files changed
+110041 -26162

No files matched your search

+20 -12
View File
@@ -1,30 +1,42 @@
<?php
declare(strict_types=1);
namespace GraphQL\Language;
class SourceLocation implements \JsonSerializable
use JsonSerializable;
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->line = $line;
$this->column = $col;
}
/**
* @return array
* @return int[]
*/
public function toArray()
{
return [
'line' => $this->line,
'column' => $this->column
'line' => $this->line,
'column' => $this->column,
];
}
/**
* @return array
* @return int[]
*/
public function toSerializableArray()
{
@@ -32,13 +44,9 @@ class SourceLocation implements \JsonSerializable
}
/**
* Specify data which should be serialized to JSON
* @link http://php.net/manual/en/jsonserializable.jsonserialize.php
* @return mixed data which can be serialized by <b>json_encode</b>,
* which is a value of any type other than a resource.
* @since 5.4.0
* @return int[]
*/
function jsonSerialize()
public function jsonSerialize()
{
return $this->toSerializableArray();
}