1 | <?php |
||
22 | class Requirements implements ContainerInjectionInterface { |
||
23 | use StringTranslationTrait; |
||
24 | |||
25 | /** |
||
26 | * The module configuration. |
||
27 | * |
||
28 | * @var \Drupal\Core\Config\Config |
||
29 | */ |
||
30 | protected $config; |
||
31 | |||
32 | /** |
||
33 | * The config.factory service. |
||
34 | * |
||
35 | * @var \Drupal\Core\Config\ConfigFactoryInterface |
||
36 | */ |
||
37 | protected $configFactory; |
||
38 | |||
39 | /** |
||
40 | * The messenger service. |
||
41 | * |
||
42 | * @var \Drupal\Core\Messenger\MessengerInterface |
||
43 | */ |
||
44 | protected $messenger; |
||
45 | |||
46 | /** |
||
47 | * The request_stack service. |
||
48 | * |
||
49 | * @var \Symfony\Component\HttpFoundation\RequestStack |
||
50 | */ |
||
51 | protected $requestStack; |
||
52 | |||
53 | /** |
||
54 | * The serialization.yaml service. |
||
55 | * |
||
56 | * @var \Drupal\Component\Serialization\SerializationInterface |
||
57 | */ |
||
58 | protected $serialization; |
||
59 | |||
60 | /** |
||
61 | * The section of Settings related to the MongoDB package. |
||
62 | * |
||
63 | * @var array |
||
64 | */ |
||
65 | protected $settings; |
||
66 | |||
67 | /** |
||
68 | * Requirements constructor. |
||
69 | * |
||
70 | * @param \Drupal\Core\Site\Settings $settings |
||
71 | * The settings service. |
||
72 | * @param \Drupal\Core\Config\ConfigFactoryInterface $configFactory |
||
73 | * The config.factory service. |
||
74 | * @param \Symfony\Component\HttpFoundation\RequestStack $requestStack |
||
75 | * The request_stack service. |
||
76 | * @param \Drupal\Component\Serialization\SerializationInterface $serialization |
||
77 | * The serialization.yaml service. |
||
78 | * @param \Drupal\Core\Messenger\MessengerInterface $messenger |
||
79 | * The messenger service. |
||
80 | */ |
||
81 | public function __construct( |
||
94 | |||
95 | /** |
||
96 | * {@inheritdoc} |
||
97 | */ |
||
98 | public static function create(ContainerInterface $container): self { |
||
106 | |||
107 | /** |
||
108 | * Apply database aliases consistency checks. |
||
109 | * |
||
110 | * @param array $state |
||
111 | * The current state of requirements checks. |
||
112 | * |
||
113 | * @return array |
||
114 | * - array: The current state of requirements checks. |
||
115 | * - bool: true if the checks added an error, false otherwise |
||
116 | */ |
||
117 | protected function checkDatabaseAliasConsistency(array $state) : array { |
||
151 | |||
152 | /** |
||
153 | * Load the configuration from default or from active configuration. |
||
154 | * |
||
155 | * @param bool $useDefault |
||
156 | * Use default configuration ? |
||
157 | */ |
||
158 | protected function loadConfig(bool $useDefault): void { |
||
169 | |||
170 | /** |
||
171 | * Check the consistency of request tracking vs configuration and environment. |
||
172 | * |
||
173 | * @param array $state |
||
174 | * The current state of requirements. |
||
175 | * |
||
176 | * @return array |
||
177 | * - array: The current state of requirements checks. |
||
178 | * - bool: true if the checks added an error, false otherwise |
||
179 | */ |
||
180 | protected function checkRequestTracking(array $state) : array { |
||
227 | |||
228 | /** |
||
229 | * Implements hook_requirements(). |
||
230 | */ |
||
231 | public function check(string $phase): array { |
||
252 | |||
253 | /** |
||
254 | * Is mod_unique_id available on this instance ? |
||
255 | * |
||
256 | * @return bool |
||
257 | * Is it ? |
||
258 | */ |
||
259 | protected function hasUniqueId(): bool { |
||
263 | |||
264 | } |
||
265 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.