Automattic\WooCommerce\Vendor\GraphQL\Language

SourceLocation{}WC 1.0

No Hooks.

Usage

$SourceLocation = new SourceLocation();
// use class methods

Methods

  1. public __construct(int $line, int $col)
  2. public jsonSerialize()
  3. public toArray()
  4. public toSerializableArray()

SourceLocation{} code WC 10.9.1

class SourceLocation implements \JsonSerializable
{
    public int $line;

    public int $column;

    public function __construct(int $line, int $col)
    {
        $this->line = $line;
        $this->column = $col;
    }

    /** @return array{line: int, column: int} */
    public function toArray(): array
    {
        return [
            'line' => $this->line,
            'column' => $this->column,
        ];
    }

    /** @return array{line: int, column: int} */
    public function toSerializableArray(): array
    {
        return $this->toArray();
    }

    /** @return array{line: int, column: int} */
    #[\ReturnTypeWillChange]
    public function jsonSerialize(): array
    {
        return $this->toArray();
    }
}