GraphQLFragmentNode::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
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