Completed
Push — 8.x-3.x ( e67c0e...2e01b0 )
by Philipp
02:27
created

GraphQLBoolean::getDefinition()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Drupal\graphql\Plugin\GraphQL\Scalars;
4
5
use Drupal\graphql\Plugin\GraphQL\PluggableSchemaBuilderInterface;
6
use Youshido\GraphQL\Type\Scalar\BooleanType;
7
8
/**
9
 * Scalar boolean type.
10
 *
11
 * @GraphQLScalar(
12
 *   id = "boolean",
13
 *   name = "Boolean",
14
 *   data_type = "boolean"
15
 * )
16
 */
17
class GraphQLBoolean extends ScalarPluginBase {
0 ignored issues
show
Bug introduced by
There is one abstract method getPluginDefinition in this class; you could implement it, or declare this class as abstract.
Loading history...
18
19
  /**
20
   * {@inheritdoc}
21
   */
22
  public function getDefinition(PluggableSchemaBuilderInterface $schemaBuilder) {
23
    if (!isset($this->definition)) {
24
      $this->definition = new BooleanType();
25
    }
26
27
    return $this->definition;
28
  }
29
}
30