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

GraphqlServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
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 16
rs 10
wmc 2
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A alter() 0 9 2
1
<?php
2
3
namespace Drupal\graphql;
4
5
use Drupal\Core\DependencyInjection\ContainerBuilder;
6
use Drupal\Core\DependencyInjection\ServiceProviderBase;
7
8
/**
9
 * GraphQL service provider.
10
 */
11
class GraphqlServiceProvider extends ServiceProviderBase {
12
13
  /**
14
   * {@inheritdoc}
15
   */
16
  public function alter(ContainerBuilder $container) {
17
    // Replace the language negotiator with a fixed one.
18
    // Can be removed if this is fixed.
19
    // https://www.drupal.org/project/drupal/issues/2952789
20
    if ($container->hasDefinition('language_negotiator')) {
21
      $container->getDefinition('language_negotiator')
22
        ->setClass(FixedLanguageNegotiator::class);
23
    }
24
  }
25
26
}
27