Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / config / tests / config_override_test / src / ConfigOverriderLowPriority.php
1 <?php
2
3 namespace Drupal\config_override_test;
4
5 use Drupal\Core\Cache\CacheableMetadata;
6 use Drupal\Core\Config\ConfigFactoryOverrideInterface;
7 use Drupal\Core\Config\StorageInterface;
8
9 /**
10  * Tests module overrides for configuration.
11  */
12 class ConfigOverriderLowPriority implements ConfigFactoryOverrideInterface {
13
14   /**
15    * {@inheritdoc}
16    */
17   public function loadOverrides($names) {
18     $overrides = [];
19     if (!empty($GLOBALS['config_test_run_module_overrides'])) {
20       if (in_array('system.site', $names)) {
21         $overrides = [
22           'system.site' => [
23             'name' => 'Should not apply because of higher priority listener',
24             // This override should apply because it is not overridden by the
25             // higher priority listener.
26             'slogan' => 'Yay for overrides!',
27           ],
28         ];
29       }
30     }
31     return $overrides;
32   }
33
34   /**
35    * {@inheritdoc}
36    */
37   public function getCacheSuffix() {
38     return 'ConfigOverriderLowPriority';
39   }
40
41   /**
42    * {@inheritdoc}
43    */
44   public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) {
45     return NULL;
46   }
47
48   /**
49    * {@inheritdoc}
50    */
51   public function getCacheableMetadata($name) {
52     return new CacheableMetadata();
53   }
54
55 }