| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function write(NodeInterface $node): string |
||
| 16 | { |
||
| 17 | $name = $this->printNode($node->getName()); |
||
|
|
|||
| 18 | $typeCondition = $this->printNode($node->getTypeCondition()); |
||
| 19 | $variableDefinitions = $this->printNodes($node->getVariableDefinitions()); |
||
| 20 | $directives = $this->printNodes($node->getDirectives()); |
||
| 21 | $selectionSet = $this->printNode($node->getSelectionSet()); |
||
| 22 | |||
| 23 | // Note: fragment variable definitions are experimental and may be changed |
||
| 24 | // or removed in the future. |
||
| 25 | return implode(' ', [ |
||
| 26 | 'fragment ' . $name . wrap('(', implode(', ', $variableDefinitions), ')'), |
||
| 27 | 'on ' . $typeCondition . ' ' . implode(' ', $directives), |
||
| 28 | $selectionSet |
||
| 29 | ]); |
||
| 40 |