ImageResourceUrl   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 2
c 1
b 0
f 0
dl 0
loc 7
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A resolveValues() 0 2 1
1
<?php
2
3
namespace Drupal\graphql_core\Plugin\GraphQL\Fields\Images;
4
5
use Drupal\graphql\GraphQL\Execution\ResolveContext;
6
use Drupal\graphql\Plugin\GraphQL\Fields\FieldPluginBase;
7
use GraphQL\Type\Definition\ResolveInfo;
8
9
/**
10
 * Retrieve the image url.
11
 *
12
 * @GraphQLField(
13
 *   id = "image_style_url",
14
 *   secure = true,
15
 *   name = "url",
16
 *   type = "String",
17
 *   parents = {"ImageResource"},
18
 *   provider = "image"
19
 * )
20
 */
21
class ImageResourceUrl extends FieldPluginBase {
22
23
  /**
24
   * {@inheritdoc}
25
   */
26
  protected function resolveValues($value, array $args, ResolveContext $context, ResolveInfo $info) {
27
    yield $value['url'];
28
  }
29
30
}
31