Completed
Pull Request — 8.x-3.x (#525)
by Philipp
02:12
created

TimestampScalar::createInstance()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 4
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Drupal\graphql\Plugin\GraphQL\Scalars\Internal;
4
5
use Drupal\graphql\Plugin\GraphQL\Scalars\ScalarPluginBase;
6
use Drupal\graphql\Plugin\SchemaBuilderInterface;
7
use Drupal\graphql\Plugin\TypePluginManager;
8
use GraphQL\Type\Definition\IntType;
9
10
/**
11
 * @GraphQLScalar(
12
 *   id = "timestamp",
13
 *   name = "Timestamp",
14
 *   type = "timestamp"
15
 * )
16
 */
17
class TimestampScalar extends ScalarPluginBase {
18
19
  /**
20
   * {@inheritdoc}
21
   */
22
  public static function createInstance(SchemaBuilderInterface $builder, TypePluginManager $manager, $definition, $id) {
23
    return new IntType([
24
      'name' => 'Timestamp',
25
    ]);
26
  }
27
28
}
29