Completed
Push — 8.x-1.x ( 8c46ac...86e5ca )
by Philipp
03:33
created

GraphQLFragmentNode::getFragment()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 2
c 1
b 1
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Drupal\graphql_twig;
4
5
/**
6
 * A Twig node for collecting GraphQL query fragments in twig templates.
7
 */
8
class GraphQLFragmentNode extends \Twig_Node {
9
10
  /**
11
   * The fragment string.
12
   *
13
   * @var string
14
   */
15
  public $fragment = "";
16
17
  /**
18
   * GraphQLFragmentNode constructor.
19
   *
20
   * @param string $fragment
21
   *   The query fragment.
22
   *
23
   * @throws \GraphQL\Error\SyntaxError
24
   *   Thrown if the GraphQL query is not valid.
25
   */
26
  public function __construct($fragment) {
27
    $this->fragment = $fragment;
28
    parent::__construct();
29
  }
30
31
}
32