Commit 57d1ee06 authored by catch's avatar catch
Browse files

Issue #3260806 by andypost: Remove deprecated code from core/lib/Drupal/Core/Config

parent 0c74a064
Loading
Loading
Loading
Loading
+0 −24
Original line number Diff line number Diff line
@@ -716,30 +716,6 @@ protected function getDefaultConfigDirectory($type, $name) {
    return $this->extensionPathResolver->getPath($type, $name) . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY;
  }

  /**
   * Wrapper for drupal_get_path().
   *
   * @param $type
   *   The type of the item; one of 'core', 'profile', 'module', 'theme', or
   *   'theme_engine'.
   * @param $name
   *   The name of the item for which the path is requested. Ignored for
   *   $type 'core'.
   *
   * @return string
   *   The path to the requested item or an empty string if the item is not
   *   found.
   *
   * @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
   *   \Drupal\Core\Extension\ExtensionList::getPath() instead.
   *
   * @see https://www.drupal.org/node/2940438
   */
  protected function drupalGetPath($type, $name) {
    @trigger_error(__METHOD__ . ' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\Core\Extension\ExtensionPathResolver::getPath() instead. See https://www.drupal.org/node/2940438', E_USER_DEPRECATED);
    return $this->extensionPathResolver->getPath($type, $name);
  }

  /**
   * Gets the install profile from settings.
   *
+0 −16
Original line number Diff line number Diff line
@@ -299,22 +299,6 @@ public function findConfigEntityDependenciesAsEntities($type, array $names, Conf
    return $entities_to_return;
  }

  /**
   * {@inheritdoc}
   */
  public function findConfigEntityDependents($type, array $names, ConfigDependencyManager $dependency_manager = NULL) {
    @trigger_error('ConfigManagerInterface::findConfigEntityDependents() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Instead you should use ConfigManagerInterface::findConfigEntityDependencies(). See https://www.drupal.org/node/3225357', E_USER_DEPRECATED);
    return $this->findConfigEntityDependencies($type, $names, $dependency_manager);
  }

  /**
   * {@inheritdoc}
   */
  public function findConfigEntityDependentsAsEntities($type, array $names, ConfigDependencyManager $dependency_manager = NULL) {
    @trigger_error('ConfigManagerInterface::findConfigEntityDependentsAsEntities() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Instead you should use ConfigManagerInterface::findConfigEntityDependenciesAsEntities(). See https://www.drupal.org/node/3225357', E_USER_DEPRECATED);
    return $this->findConfigEntityDependenciesAsEntities($type, $names, $dependency_manager);
  }

  /**
   * {@inheritdoc}
   */
+0 −42
Original line number Diff line number Diff line
@@ -132,48 +132,6 @@ public function findConfigEntityDependencies($type, array $names);
   */
  public function findConfigEntityDependenciesAsEntities($type, array $names);

  /**
   * Deprecated method to find config entity dependencies.
   *
   * @param string $type
   *   The type of dependency being checked. Either 'module', 'theme', 'config'
   *   or 'content'.
   * @param array $names
   *   The specific names to check. If $type equals 'module' or 'theme' then it
   *   should be a list of module names or theme names. In the case of 'config'
   *   or 'content' it should be a list of configuration dependency names.
   *
   * @return \Drupal\Core\Config\Entity\ConfigEntityDependency[]
   *   An array of configuration entity dependency objects.
   *
   * @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0.
   *   Instead you should use
   *   ConfigManagerInterface::findConfigEntityDependencies().
   * @see https://www.drupal.org/node/3225357
   */
  public function findConfigEntityDependents($type, array $names);

  /**
   * Deprecated method to find config entity dependencies as entities.
   *
   * @param string $type
   *   The type of dependency being checked. Either 'module', 'theme', 'config'
   *   or 'content'.
   * @param array $names
   *   The specific names to check. If $type equals 'module' or 'theme' then it
   *   should be a list of module names or theme names. In the case of 'config'
   *   or 'content' it should be a list of configuration dependency names.
   *
   * @return \Drupal\Core\Config\Entity\ConfigEntityInterface[]
   *   An array of dependencies as configuration entities.
   *
   * @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0.
   *   Instead you should use
   *   ConfigManagerInterface::findConfigEntityDependenciesAsEntities().
   * @see https://www.drupal.org/node/3225357
   */
  public function findConfigEntityDependentsAsEntities($type, array $names);

  /**
   * Lists which config entities to update and delete on removal of a dependency.
   *
+0 −20
Original line number Diff line number Diff line
@@ -638,26 +638,6 @@ public function testContentEntityDelete() {
    $this->assertEmpty($config_entities['unchanged'], 'No dependencies of the content entity will be unchanged.');
  }

  /**
   * @group legacy
   */
  public function testFindConfigEntityDependentsDeprecation() {
    $this->expectDeprecation('ConfigManagerInterface::findConfigEntityDependents() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Instead you should use ConfigManagerInterface::findConfigEntityDependencies(). See https://www.drupal.org/node/3225357');
    /** @var \Drupal\Core\Config\ConfigManagerInterface $config_manager */
    $config_manager = \Drupal::service('config.manager');
    $config_manager->findConfigEntityDependents('module', ['system']);
  }

  /**
   * @group legacy
   */
  public function testFindConfigEntityDependentsAsEntitiesDeprecation() {
    $this->expectDeprecation('ConfigManagerInterface::findConfigEntityDependentsAsEntities() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Instead you should use ConfigManagerInterface::findConfigEntityDependenciesAsEntities(). See https://www.drupal.org/node/3225357');
    /** @var \Drupal\Core\Config\ConfigManagerInterface $config_manager */
    $config_manager = \Drupal::service('config.manager');
    $config_manager->findConfigEntityDependentsAsEntities('module', ['system']);
  }

  /**
   * Gets a list of identifiers from an array of configuration entities.
   *