EntityDescription::resolveValues()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 2
nc 2
nop 4
1
<?php
2
3
namespace Drupal\graphql_core\Plugin\GraphQL\Fields\Entity;
4
5
use Drupal\Core\Entity\EntityDescriptionInterface;
0 ignored issues
show
Bug introduced by
The type Drupal\Core\Entity\EntityDescriptionInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Drupal\graphql\GraphQL\Execution\ResolveContext;
7
use Drupal\graphql\Plugin\GraphQL\Fields\FieldPluginBase;
8
use GraphQL\Type\Definition\ResolveInfo;
9
10
/**
11
 * @GraphQLField(
12
 *   id = "entity_description",
13
 *   secure = true,
14
 *   name = "entityDescription",
15
 *   type = "String",
16
 *   parents = {"EntityDescribable"}
17
 * )
18
 */
19
class EntityDescription extends FieldPluginBase {
20
21
  /**
22
   * {@inheritdoc}
23
   */
24
  public function resolveValues($value, array $args, ResolveContext $context, ResolveInfo $info) {
25
    if ($value instanceof EntityDescriptionInterface) {
26
      yield $value->getDescription();
27
    }
28
  }
29
30
}
31