AST
2 months ago
BlockString.php
2 months ago
DirectiveLocation.php
2 months ago
Lexer.php
2 months ago
Parser.php
2 months ago
Printer.php
2 months ago
Source.php
2 months ago
SourceLocation.php
2 months ago
Token.php
2 months ago
Visitor.php
2 months ago
VisitorOperation.php
2 months ago
VisitorRemoveNode.php
2 months ago
VisitorSkipNode.php
2 months ago
VisitorStop.php
2 months ago
SourceLocation.php
39 lines
| 1 | <?php declare(strict_types=1); |
| 2 | |
| 3 | namespace Automattic\WooCommerce\Vendor\GraphQL\Language; |
| 4 | |
| 5 | class SourceLocation implements \JsonSerializable |
| 6 | { |
| 7 | public int $line; |
| 8 | |
| 9 | public int $column; |
| 10 | |
| 11 | public function __construct(int $line, int $col) |
| 12 | { |
| 13 | $this->line = $line; |
| 14 | $this->column = $col; |
| 15 | } |
| 16 | |
| 17 | /** @return array{line: int, column: int} */ |
| 18 | public function toArray(): array |
| 19 | { |
| 20 | return [ |
| 21 | 'line' => $this->line, |
| 22 | 'column' => $this->column, |
| 23 | ]; |
| 24 | } |
| 25 | |
| 26 | /** @return array{line: int, column: int} */ |
| 27 | public function toSerializableArray(): array |
| 28 | { |
| 29 | return $this->toArray(); |
| 30 | } |
| 31 | |
| 32 | /** @return array{line: int, column: int} */ |
| 33 | #[\ReturnTypeWillChange] |
| 34 | public function jsonSerialize(): array |
| 35 | { |
| 36 | return $this->toArray(); |
| 37 | } |
| 38 | } |
| 39 |