| Server IP : 62.60.133.156 / Your IP : 216.73.217.51 Web Server : LiteSpeed System : Linux linux24.centraldnserver.com 4.18.0-553.141.2.lve.el8.x86_64 #1 SMP Wed Jul 8 16:10:02 UTC 2026 x86_64 User : mimradmin ( 1166) PHP Version : 7.4.33 Disable Function : show_source, system, shell_exec, passthru, exec, popen, proc_open MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/mimradmin/www/wp-content/plugins/woocommerce/lib/packages/GraphQL/Language/AST/ |
Upload File : |
<?php declare(strict_types=1);
namespace Automattic\WooCommerce\Vendor\GraphQL\Language\AST;
use Automattic\WooCommerce\Vendor\GraphQL\Language\Source;
use Automattic\WooCommerce\Vendor\GraphQL\Language\Token;
/**
* Contains a range of UTF-8 character offsets and token references that
* identify the region of the source from which the AST derived.
*
* @phpstan-type LocationArray array{start: int, end: int}
*/
class Location
{
/** The character offset at which this Node begins. */
public int $start;
/** The character offset at which this Node ends. */
public int $end;
/** The Token at which this Node begins. */
public ?Token $startToken = null;
/** The Token at which this Node ends. */
public ?Token $endToken = null;
/** The Source document the AST represents. */
public ?Source $source = null;
public static function create(int $start, int $end): self
{
$tmp = new static();
$tmp->start = $start;
$tmp->end = $end;
return $tmp;
}
public function __construct(?Token $startToken = null, ?Token $endToken = null, ?Source $source = null)
{
$this->startToken = $startToken;
$this->endToken = $endToken;
$this->source = $source;
if ($startToken === null || $endToken === null) {
return;
}
$this->start = $startToken->start;
$this->end = $endToken->end;
}
/** @return LocationArray */
public function toArray(): array
{
return [
'start' => $this->start,
'end' => $this->end,
];
}
}