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

Upload::parseLiteral()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Drupal\graphql\Plugin\GraphQL\Scalars\Upload;
4
5
use Drupal\graphql\Plugin\GraphQL\Scalars\ScalarPluginBase;
6
7
/**
8
 * @GraphQLScalar(
9
 *   id = "upload",
10
 *   name = "Upload"
11
 * )
12
 */
13
class Upload extends ScalarPluginBase {
0 ignored issues
show
Bug introduced by
There is one abstract method getPluginDefinition in this class; you could implement it, or declare this class as abstract.
Loading history...
14
15
  /**
16
   * {@inheritdoc}
17
   */
18
  public static function serialize($value) {
19
    throw new \LogicException('Cannot serialize uploaded files.');
20
  }
21
22
  /**
23
   * {@inheritdoc}
24
   */
25
  public static function parseValue($value) {
26
    return $value;
27
  }
28
29
  /**
30
   * {@inheritdoc}
31
   */
32
  public static function parseLiteral($ast) {
33
    throw new \LogicException('Uploaded files have to be referenced in variables.');
34
  }
35
36
}
37