Completed
Pull Request — 8.x-3.x (#524)
by Sebastian
03:35
created

Map::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\TypedData;
4
5
use Drupal\graphql\GraphQL\Type\Scalars\MapType;
6
use Drupal\graphql\Plugin\GraphQL\PluggableSchemaBuilderInterface;
7
use Drupal\graphql\Plugin\GraphQL\Scalars\GraphQLString;
8
use Drupal\graphql\Plugin\GraphQL\Scalars\ScalarPluginBase;
9
10
/**
11
 * @GraphQLScalar(
12
 *   id = "map",
13
 *   name = "Map",
14
 *   type = "map"
15
 * )
16
 */
17
class Map 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 MapType();
25
    }
26
27
    return $this->definition;
28
  }
29
30
}
31