QueryMapListBuilder::buildHeader()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Drupal\graphql\Controller;
4
5
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
0 ignored issues
show
Bug introduced by
The type Drupal\Core\Config\Entity\ConfigEntityListBuilder 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\Core\Entity\EntityInterface;
0 ignored issues
show
Bug introduced by
The type Drupal\Core\Entity\EntityInterface 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...
7
8
class QueryMapListBuilder extends ConfigEntityListBuilder {
9
10
  /**
11
   * {@inheritdoc}
12
   */
13
  public function buildHeader() {
14
    return [
15
      'version' => $this->t('Query maps'),
16
    ] + parent::buildHeader();
17
  }
18
19
  /**
20
   * {@inheritdoc}
21
   */
22
  public function buildRow(EntityInterface $entity) {
23
    return [
24
      'version' => $entity->id(),
25
    ] + parent::buildRow($entity);
26
  }
27
28
  /**
29
   * {@inheritdoc}
30
   */
31
  public function getDefaultOperations(EntityInterface $entity) {
32
    /** @var \Drupal\field\FieldConfigInterface $entity */
33
    $operations = parent::getDefaultOperations($entity);
34
35
    $operations['inspect'] = [
36
      'title' => $this->t('Inspect'),
37
      'weight' => 10,
38
      'url' => $entity->toUrl('inspect-form'),
39
    ];
40
41
    return $operations;
42
  }
43
44
}
45