JsonLeaf   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 10
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A applies() 0 3 1
1
<?php
2
3
namespace Drupal\graphql_json\Plugin\GraphQL\Types;
4
5
6
use Drupal\graphql\GraphQL\Execution\ResolveContext;
7
use Drupal\graphql\Plugin\GraphQL\Types\TypePluginBase;
8
use GraphQL\Type\Definition\ResolveInfo;
9
10
/**
11
 * GraphQL type for json list nodes.
12
 *
13
 * @GraphQLType(
14
 *   id = "json_leaf",
15
 *   name = "JsonLeaf",
16
 *   unions = {"JsonNode"}
17
 * )
18
 */
19
class JsonLeaf extends TypePluginBase {
20
21
  /**
22
   * {@inheritdoc}
23
   */
24
  public function applies($value, ResolveContext $context, ResolveInfo $info) {
25
    return !is_array($value);
26
  }
27
28
}
29