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

FixedLanguageNegotiator::getEnabledNegotiators()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 9.4285
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, SORT_NUMERIC);
22
    return $negotiators;
23
  }
24
25
}
26