Completed
Pull Request — 8.x-3.x (#442)
by Sebastian
01:51
created

EnumType::getValues()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Drupal\graphql\GraphQL\Type;
4
5
use Drupal\graphql\Plugin\GraphQL\Enums\EnumPluginBase;
6
use Drupal\graphql\Plugin\GraphQL\TypeSystemPluginReferenceInterface;
7
use Drupal\graphql\Plugin\GraphQL\TypeSystemPluginReferenceTrait;
8
use Youshido\GraphQL\Config\Object\EnumTypeConfig;
9
use Youshido\GraphQL\Type\Enum\AbstractEnumType;
10
11
class EnumType extends AbstractEnumType implements TypeSystemPluginReferenceInterface {
12
  use TypeSystemPluginReferenceTrait;
13
14
  /**
15
   * The associated type system plugin.
16
   *
17
   * @var \Drupal\graphql\Plugin\GraphQL\Enums\EnumPluginBase
18
   */
19
  protected $plugin;
20
21
  /**
22
   * {@inheritdoc}
23
   */
24
  public function __construct(EnumPluginBase $plugin, array $config = []) {
25
    $this->plugin = $plugin;
26
    $this->config = new EnumTypeConfig($config, $this);
27
  }
28
29
  /**
30
   * {@inheritdoc}
31
   */
32
  public function getValues() {
33
    return $this->getConfigValue('values', []);
34
  }
35
}
36