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

LanguageSwitchLinkLanguage::resolveValues()   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 3
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Drupal\graphql_core\Plugin\GraphQL\Fields\LanguageSwitch;
4
5
use Drupal\graphql\Plugin\GraphQL\Fields\FieldPluginBase;
6
use Youshido\GraphQL\Execution\ResolveInfo;
7
8
/**
9
 * @GraphQLField(
10
 *   id = "language_switch_link_language",
11
 *   secure = true,
12
 *   name = "language",
13
 *   type = "Language",
14
 *   parents = {"LanguageSwitchLink"}
15
 * )
16
 */
17
class LanguageSwitchLinkLanguage 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...
18
19
  /**
20
   * {@inheritdoc}
21
   */
22
  protected function resolveValues($value, array $args, ResolveInfo $info) {
23
    /** @var \Drupal\Core\Language\LanguageInterface $language */
24
    $language = $value['link']['language'];
25
    yield $language;
26
  }
27
28
}
29