1 | <?php |
||
12 | class Source |
||
13 | { |
||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $body; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $name; |
||
23 | |||
24 | /** |
||
25 | * @var int |
||
26 | */ |
||
27 | protected $length; |
||
28 | |||
29 | /** |
||
30 | * Constructor. |
||
31 | * |
||
32 | * @param string $body |
||
33 | * @param string $name |
||
34 | */ |
||
35 | 426 | public function __construct($body, $name = 'GraphQL') |
|
41 | |||
42 | /** |
||
43 | * @return string |
||
44 | */ |
||
45 | 426 | public function getBody() |
|
49 | |||
50 | /** |
||
51 | * @return string |
||
52 | */ |
||
53 | public function getName() |
||
57 | |||
58 | /** |
||
59 | * @return int |
||
60 | */ |
||
61 | 426 | public function getLength() |
|
65 | |||
66 | /** |
||
67 | * Takes a Source and a UTF-8 character offset, and returns the |
||
68 | * corresponding line and column as a SourceLocation. |
||
69 | * |
||
70 | * @param $position |
||
71 | * |
||
72 | * @return \Fubhy\GraphQL\Language\SourceLocation |
||
73 | */ |
||
74 | public function getLocation($position) |
||
89 | } |
||
90 |