Unverified Commit 2f1c7166 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3106216 by Spokje, longwave, alexpott, apaderno, Hardik_Patel_12,...

Issue #3106216 by Spokje, longwave, alexpott, apaderno, Hardik_Patel_12, daffie: Remove unused variables from core
parent a0b2090a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -516,7 +516,7 @@ function drupal_flush_all_caches($kernel = NULL) {
  $module_handler = \Drupal::moduleHandler();
  // Flush all persistent caches.
  $module_handler->invokeAll('cache_flush');
  foreach (Cache::getBins() as $service_id => $cache_backend) {
  foreach (Cache::getBins() as $cache_backend) {
    $cache_backend->deleteAll();
  }

+1 −2
Original line number Diff line number Diff line
@@ -1173,7 +1173,7 @@ function install_verify_database_ready() {
  $table = key($system_schema);

  $existing_install = FALSE;
  if ($database = Database::getConnectionInfo()) {
  if (Database::getConnectionInfo()) {
    try {
      $existing_install = Database::getConnection()->schema()->tableExists($table);
    }
@@ -2424,7 +2424,6 @@ function install_config_revert_install_changes() {
      $config_importer->import();
    }
    catch (ConfigImporterException $e) {
      global $install_state;
      $messenger = \Drupal::messenger();
      // There are validation errors.
      $messenger->addError(t('The configuration synchronization failed validation.'));
+2 −2
Original line number Diff line number Diff line
@@ -250,8 +250,8 @@ protected function getServiceDefinition(Definition $definition) {
      $service['shared'] = $definition->isShared();
    }

    if (($decorated = $definition->getDecoratedService()) !== NULL) {
      throw new InvalidArgumentException("The 'decorated' definition is not supported by the Drupal 8 run-time container. The Container Builder should have resolved that during the DecoratorServicePass compiler pass.");
    if ($definition->getDecoratedService() !== NULL) {
      throw new InvalidArgumentException("The 'decorated' definition is not supported by the Drupal run-time container. The Container Builder should have resolved that during the DecoratorServicePass compiler pass.");
    }

    if ($callable = $definition->getFactory()) {
+5 −5
Original line number Diff line number Diff line
@@ -130,8 +130,8 @@ public function dispatch($event/*, string $event_name = NULL*/) {
      }

      // Invoke listeners and resolve callables if necessary.
      foreach ($this->listeners[$event_name] as $priority => &$definitions) {
        foreach ($definitions as $key => &$definition) {
      foreach ($this->listeners[$event_name] as &$definitions) {
        foreach ($definitions as &$definition) {
          if (!isset($definition['callable'])) {
            $definition['callable'] = [$this->container->get($definition['service'][0]), $definition['service'][1]];
          }
@@ -173,8 +173,8 @@ public function getListeners($event_name = NULL): array {
      }

      // Collect listeners and resolve callables if necessary.
      foreach ($this->listeners[$event_name] as $priority => &$definitions) {
        foreach ($definitions as $key => &$definition) {
      foreach ($this->listeners[$event_name] as &$definitions) {
        foreach ($definitions as &$definition) {
          if (!isset($definition['callable'])) {
            $definition['callable'] = [$this->container->get($definition['service'][0]), $definition['service'][1]];
          }
@@ -202,7 +202,7 @@ public function getListenerPriority($event_name, $listener): ?int {
    }
    // Resolve service definitions if the listener has not been found so far.
    foreach ($this->listeners[$event_name] as $priority => &$definitions) {
      foreach ($definitions as $key => &$definition) {
      foreach ($definitions as &$definition) {
        if (!isset($definition['callable'])) {
          // Once the callable is retrieved we keep it for subsequent method
          // invocations on this class.
+1 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ public function build($class_name) {
    // In order to avoid that, check for each interface, whether one of its
    // parents is also in the list and exclude it.
    if ($interfaces = $reflection->getInterfaces()) {
      foreach ($interfaces as $interface_name => $interface) {
      foreach ($interfaces as $interface) {
        // Exclude all parents from the list of implemented interfaces of the
        // class.
        if ($parent_interfaces = $interface->getInterfaceNames()) {
Loading