Completed
Pull Request — 8.x-3.x (#433)
by Sebastian
03:58 queued 01:58
created

GraphQLDateTime::__construct()   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 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Drupal\graphql\Plugin\GraphQL\Scalars;
4
5
use Drupal\graphql\Plugin\GraphQL\SchemaBuilderInterface;
6
use Drupal\graphql\Plugin\GraphQL\Traits\CacheablePluginTrait;
7
use Drupal\graphql\Plugin\GraphQL\Traits\PluginTrait;
8
use Drupal\graphql\Plugin\GraphQL\TypeSystemPluginInterface;
9
use Youshido\GraphQL\Type\Scalar\DateTimeType;
10
11
/**
12
 * Scalar string type.
13
 *
14
 * @GraphQLScalar(
15
 *   id = "date_time",
16
 *   name = "DateTime"
17
 * )
18
 */
19
class GraphQLDateTime extends DateTimeType implements TypeSystemPluginInterface {
20
  use PluginTrait;
21
  use CacheablePluginTrait;
22
23
  protected $format = 'Y-m-d H:i:s';
24
25
  /**
26
   * {@inheritdoc}
27
   */
28
  public function __construct(array $configuration, $pluginId, $pluginDefinition) {
29
    $this->constructPlugin($configuration, $pluginId, $pluginDefinition);
30
  }
31
32
  /**
33
   * {@inheritdoc}
34
   */
35
  public function buildConfig(SchemaBuilderInterface $schemaManager) {
36
    // Nothing to do here.
37
  }
38
}
39