Code Duplication    Length = 9-9 lines in 2 locations

src/Plugin/GraphQL/InputTypes/InputTypePluginBase.php 1 location

@@ 111-119 (lines=9) @@
108
109
      $type = array_pop($types) ?: $schemaBuilder->findByName('String', [GRAPHQL_SCALAR_PLUGIN])->getDefinition($schemaBuilder);
110
    }
111
    else {
112
      $typeInfo = is_array($field) ? $field['type'] : $field;
113
114
      $type = is_array($typeInfo) ? $this->buildEnumConfig($typeInfo, $field['enum_type_name']) : $schemaBuilder->findByName($typeInfo, [
115
        GRAPHQL_INPUT_TYPE_PLUGIN,
116
        GRAPHQL_SCALAR_PLUGIN,
117
        GRAPHQL_ENUM_PLUGIN,
118
      ])->getDefinition($schemaBuilder);
119
    }
120
121
    if (isset($type) && $type instanceof TypeInterface) {
122
      $nullable = is_array($field) && array_key_exists('nullable', $field) && $field['nullable'];

src/Plugin/GraphQL/Traits/ArgumentAwarePluginTrait.php 1 location

@@ 76-84 (lines=9) @@
73
74
      $type = $plugin->getDefinition($schemaBuilder);
75
    }
76
    else {
77
      $typeInfo = is_array($argument) ? $argument['type'] : $argument;
78
79
      $type = is_array($typeInfo) ? $this->buildEnumConfig($typeInfo, $argument['enum_type_name']) : $schemaBuilder->findByName($typeInfo, [
80
        GRAPHQL_INPUT_TYPE_PLUGIN,
81
        GRAPHQL_SCALAR_PLUGIN,
82
        GRAPHQL_ENUM_PLUGIN,
83
      ])->getDefinition($schemaBuilder);
84
    }
85
86
    if (isset($type) && $type instanceof TypeInterface) {
87
      $nullable = is_array($argument) && (array_key_exists('nullable', $argument) && $argument['nullable'] || array_key_exists('default', $argument));