Completed
Pull Request — 8.x-3.x (#550)
by Philipp
02:14
created

FixedLanguageNegotiator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
rs 10
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getEnabledNegotiators() 0 5 1
1
<?php
2
3
namespace Drupal\graphql;
4
5
use Drupal\language\LanguageNegotiator;
6
7
/**
8
 * Fixed language negotiator.
9
 *
10
 * Respects the negotiator weights.
11
 *
12
 * @see https://www.drupal.org/project/drupal/issues/2952789
13
 */
14
class FixedLanguageNegotiator extends LanguageNegotiator {
15
16
  /**
17
   * {@inheritdoc}
18
   */
19
  protected function getEnabledNegotiators($type) {
20
    $negotiators = parent::getEnabledNegotiators($type);
21
    asort($negotiators);
22
    return $negotiators;
23
  }
24
25
}
26