Code Duplication    Length = 16-18 lines in 2 locations

src/Plugin/GraphQL/Fields/FieldPluginBase.php 1 location

@@ 36-53 (lines=18) @@
33
  /**
34
   * {@inheritdoc}
35
   */
36
  public function getDefinition(PluggableSchemaBuilderInterface $schemaBuilder) {
37
    if (!isset($this->definition)) {
38
      $definition = $this->getPluginDefinition();
39
40
      $config = [
41
        'name' => $this->buildName(),
42
        'description' => $this->buildDescription(),
43
        'type' => $this->buildType($schemaBuilder),
44
        'args' => $this->buildArguments($schemaBuilder),
45
        'isDeprecated' => !empty($definition['deprecated']),
46
        'deprecationReason' => !empty($definition['deprecated']) ? !empty($definition['deprecated']) : '',
47
      ];
48
49
      $this->definition = new Field($this, $schemaBuilder, $config);
50
    }
51
52
    return $this->definition;
53
  }
54
55
  /**
56
   * {@inheritdoc}

src/Plugin/GraphQL/Mutations/MutationPluginBase.php 1 location

@@ 32-47 (lines=16) @@
29
  /**
30
   * {@inheritdoc}
31
   */
32
  public function getDefinition(PluggableSchemaBuilderInterface $schemaBuilder) {
33
    if (!isset($this->definition)) {
34
      $definition = $this->getPluginDefinition();
35
36
      $this->definition = new Field($this, $schemaBuilder, [
37
        'name' => $this->buildName(),
38
        'description' => $this->buildDescription(),
39
        'type' => $this->buildType($schemaBuilder),
40
        'args' => $this->buildArguments($schemaBuilder),
41
        'isDeprecated' => !empty($definition['deprecated']),
42
        'deprecationReason' => !empty($definition['deprecated']) ? !empty($definition['deprecated']) : '',
43
      ]);
44
    }
45
46
    return $this->definition;
47
  }
48
49
  /**
50
   * {@inheritdoc}