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

TimestampScalar   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 12
rs 10
c 1
b 0
f 0
wmc 1
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A createInstance() 0 5 1
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\SchemaBuilder;
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(SchemaBuilder $builder, TypePluginManager $manager, $definition, $id) {
23
    return new IntType([
24
      'name' => 'Timestamp',
25
    ]);
26
  }
27
28
}
29