Unverified Commit 6923e5eb authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3197729 by Spokje: Remove forward/bc layer for Symfony Definition::setDeprecated() method

parent 7b324dd8
Loading
Loading
Loading
Loading
+4 −16
Original line number Diff line number Diff line
@@ -163,14 +163,8 @@ private function parseDefinition($id, $service, $file)
            }

            if (array_key_exists('deprecated', $service)) {
                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;
@@ -210,14 +204,8 @@ private function parseDefinition($id, $service, $file)
        }

        if (array_key_exists('deprecated', $service)) {
            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'])) {
+1 −8
Original line number Diff line number Diff line
@@ -19,14 +19,7 @@ class UpdateServiceProvider implements ServiceProviderInterface, ServiceModifier
   */
  public function register(ContainerBuilder $container) {
    $definition = new Definition('Drupal\Core\Cache\NullBackend', ['null']);
    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);