Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / language / src / LanguageNegotiationMethodBase.php
1 <?php
2
3 namespace Drupal\language;
4
5 use Drupal\Core\Config\ConfigFactoryInterface;
6 use Drupal\Core\Language\LanguageInterface;
7 use Drupal\Core\Session\AccountInterface;
8
9 /**
10  * Base class for language negotiation methods.
11  */
12 abstract class LanguageNegotiationMethodBase implements LanguageNegotiationMethodInterface {
13
14   /**
15    * The language manager.
16    *
17    * @var \Drupal\Core\Language\LanguageManagerInterface
18    */
19   protected $languageManager;
20
21   /**
22    * The configuration factory.
23    *
24    * @var \Drupal\Core\Config\ConfigFactoryInterface
25    */
26   protected $config;
27
28   /**
29    * The current active user.
30    *
31    * @var \Drupal\Core\Session\AccountInterface
32    */
33   protected $currentUser;
34
35   /**
36    * {@inheritdoc}
37    */
38   public function setLanguageManager(ConfigurableLanguageManagerInterface $language_manager) {
39     $this->languageManager = $language_manager;
40   }
41
42   /**
43    * {@inheritdoc}
44    */
45   public function setConfig(ConfigFactoryInterface $config) {
46     $this->config = $config;
47   }
48
49   /**
50    * {@inheritdoc}
51    */
52   public function setCurrentUser(AccountInterface $current_user) {
53     $this->currentUser = $current_user;
54   }
55
56   /**
57    * {@inheritdoc}
58    */
59   public function persist(LanguageInterface $language) {
60     // Default implementation persists nothing.
61   }
62
63 }