GraphQL   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A renderExposedForm() 0 8 1
1
<?php
2
3
namespace Drupal\graphql_views\Plugin\views\exposed_form;
4
5
use Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase;
6
7
/**
8
 * Exposed form plugin that prevents any rendering.
9
 *
10
 * @ViewsExposedForm(
11
 *   id = "graphql",
12
 *   title = @Translation("GraphQL"),
13
 *   help = @Translation("Prevents rendering of exposed forms")
14
 * )
15
 */
16
class GraphQL extends ExposedFormPluginBase {
17
18
  /**
19
   * {@inheritdoc}
20
   */
21
  public function renderExposedForm($block = FALSE) {
22
    // We don't render a form. Due to this, we won't have a form state which is
23
    // otherwise required by views to read the exposed form values from. Hence,
24
    // we need to manually write these values.
25
    $this->view->exposed_data = $this->view->getExposedInput();
26
27
    return NULL;
28
  }
29
}
30