diff --git a/core/lib/Drupal/Core/Config/ConfigFactory.php b/core/lib/Drupal/Core/Config/ConfigFactory.php index 1a5acab..1fbca62 100644 --- a/core/lib/Drupal/Core/Config/ConfigFactory.php +++ b/core/lib/Drupal/Core/Config/ConfigFactory.php @@ -13,19 +13,30 @@ namespace Drupal\Core\Config; * The configuration object factory instantiates a Config object for each * configuration object name that is accessed and returns it to callers. * + * @see Drupal\Core\Config\Config + * * Each configuration object gets a storage dispatcher object injected, which * determines the storage controller to use for reading and writing the * configuration data. * - * @see Drupal\Core\Config\Config + * @see Drupal\Core\Config\StorageDispatcher */ class ConfigFactory { - protected $configClass; - + /** + * A storage dispatcher instance to use for reading and writing configuration data. + * + * @var Drupal\Core\Config\StorageDispatcher + */ protected $storageDispatcher; - public function __construct($config_class, StorageDispatcher $storage_dispatcher) { - $this->configClass = $config_class; + /** + * Constructs the Config factory. + * + * @param Drupal\Core\Config\StorageDispatcher $storage_dispatcher + * The storage dispatcher object to use for reading and writing + * configuration data. + */ + public function __construct(StorageDispatcher $storage_dispatcher) { $this->storageDispatcher = $storage_dispatcher; } @@ -57,7 +68,7 @@ class ConfigFactory { // @todo The decrease of CPU time is interesting, since that means that // ContainerBuilder involves plenty of function calls (which are known to // be slow in PHP). - $config = new $this->configClass($this->storageDispatcher); + $config = new Config($this->storageDispatcher); return $config->setName($name); } } diff --git a/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php b/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php index b811199..3dc0df5 100644 --- a/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php +++ b/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php @@ -49,7 +49,6 @@ class ContainerBuilder extends BaseContainerBuilder { // Register configuration object factory. $this->register('config.factory', 'Drupal\Core\Config\ConfigFactory') - ->addArgument('Drupal\Core\Config\Config') ->addArgument(new Reference('config.storage.dispatcher')); } }