Skip to content
Snippets Groups Projects
Unverified Commit 47344caf authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3187857 by longwave, ilgnerfagundes, catch, alexpott: [Symfony 6]...

Issue #3187857 by longwave, ilgnerfagundes, catch, alexpott: [Symfony 6] Service deprecation messages require more fields
parent 99e29476
No related branches found
No related tags found
No related merge requests found
......@@ -157,7 +157,14 @@ private function parseDefinition($id, $service, $file)
}
if (array_key_exists('deprecated', $service)) {
$alias->setDeprecated(true, $service['deprecated']);
if (method_exists($alias, 'getDeprecation')) {
$deprecation = \is_array($service['deprecated']) ? $service['deprecated'] : ['message' => $service['deprecated']];
$alias->setDeprecated($deprecation['package'] ?? '', $deprecation['version'] ?? '', $deprecation['message']);
} else {
// @todo Remove when we no longer support Symfony 4 in
// https://www.drupal.org/project/drupal/issues/3197729
$alias->setDeprecated(true, $service['deprecated']);
}
}
return;
......@@ -197,7 +204,14 @@ private function parseDefinition($id, $service, $file)
}
if (array_key_exists('deprecated', $service)) {
$definition->setDeprecated(true, $service['deprecated']);
if (method_exists($definition, 'getDeprecation')) {
$deprecation = \is_array($service['deprecated']) ? $service['deprecated'] : ['message' => $service['deprecated']];
$definition->setDeprecated($deprecation['package'] ?? '', $deprecation['version'] ?? '', $deprecation['message']);
} else {
// @todo Remove when we no longer support Symfony 4 in
// https://www.drupal.org/project/drupal/issues/3197729
$definition->setDeprecated(true, $service['deprecated']);
}
}
if (isset($service['factory'])) {
......
......@@ -19,7 +19,14 @@ class UpdateServiceProvider implements ServiceProviderInterface, ServiceModifier
*/
public function register(ContainerBuilder $container) {
$definition = new Definition('Drupal\Core\Cache\NullBackend', ['null']);
$definition->setDeprecated(TRUE, 'The "%service_id%\" service is deprecated. While updating Drupal all caches use \Drupal\Core\Update\UpdateBackend. See https://www.drupal.org/node/3066407');
if (method_exists($definition, 'getDeprecation')) {
$definition->setDeprecated('drupal/core', '8.8.0', 'The "%service_id%\" service is deprecated. While updating Drupal all caches use \Drupal\Core\Update\UpdateBackend. See https://www.drupal.org/node/3066407');
}
else {
// @todo Remove when we no longer support Symfony 4 in
// https://www.drupal.org/project/drupal/issues/3197729
$definition->setDeprecated(TRUE, 'The "%service_id%\" service is deprecated. While updating Drupal all caches use \Drupal\Core\Update\UpdateBackend. See https://www.drupal.org/node/3066407');
}
$definition->setPublic(TRUE);
$container->setDefinition('cache.null', $definition);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment