Completed
Pull Request — 8.x-3.x (#508)
by Sebastian
03:02
created

ImageResourceHeight::resolveValues()   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_core\Plugin\GraphQL\Fields\Images;
4
5
use Drupal\graphql\Plugin\GraphQL\Fields\FieldPluginBase;
6
use Drupal\image\Plugin\Field\FieldType\ImageItem;
7
use Youshido\GraphQL\Execution\ResolveInfo;
8
9
/**
10
 * Retrieve the image height.
11
 *
12
 * @GraphQLField(
13
 *   id = "image_style_height",
14
 *   secure = true,
15
 *   name = "height",
16
 *   type = "Int",
17
 *   parents = {"ImageResource"},
18
 *   provider = "image"
19
 * )
20
 */
21
class ImageResourceHeight extends FieldPluginBase {
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...
22
23
  /**
24
   * {@inheritdoc}
25
   */
26
  protected function resolveValues($value, array $args, ResolveInfo $info) {
27
    yield (int) $value['height'];
28
  }
29
30
}
31