Skip to content
Snippets Groups Projects
Commit 29bec0d0 authored by auth's avatar auth Committed by Adriano
Browse files

Issue #3308848 by auth, aronne: Use the ModuleHandlerInterface instead of the...

Issue #3308848 by auth, aronne: Use the ModuleHandlerInterface instead of the ModuleHandler concrete implementation
parent dc18de7f
No related branches found
No related tags found
No related merge requests found
services:
http_client_manager.http_services_api:
class: Drupal\http_client_manager\HttpServiceApiHandler
arguments: ["@app.root", "@module_handler", "@string_translation", "@controller_resolver", "@config.factory"]
arguments: ["@app.root", "@module_handler", "@config.factory"]
http_client_manager.factory:
class: Drupal\http_client_manager\HttpClientManagerFactory
......
......@@ -4,7 +4,7 @@ namespace Drupal\http_client_manager;
use Drupal\Component\Discovery\YamlDiscovery;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Extension\ModuleHandler;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Site\Settings;
use Drupal\Core\StringTranslation\TranslationManager;
use Drupal\Core\Controller\ControllerResolver;
......@@ -29,26 +29,12 @@ class HttpServiceApiHandler implements HttpServiceApiHandlerInterface {
protected $root;
/**
* Drupal\Core\Extension\ModuleHandler definition.
* The Module Handler Service.
*
* @var \Drupal\Core\Extension\ModuleHandler
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected $moduleHandler;
/**
* Drupal\Core\StringTranslation\TranslationManager definition.
*
* @var \Drupal\Core\StringTranslation\TranslationManager
*/
protected $stringTranslation;
/**
* Drupal\Core\Controller\ControllerResolver definition.
*
* @var \Drupal\Core\Controller\ControllerResolver
*/
protected $controllerResolver;
/**
* All defined services api descriptions.
*
......@@ -68,20 +54,14 @@ class HttpServiceApiHandler implements HttpServiceApiHandlerInterface {
*
* @param string $root
* The Application root.
* @param \Drupal\Core\Extension\ModuleHandler $module_handler
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler service.
* @param \Drupal\Core\StringTranslation\TranslationManager $string_translation
* The string translation manager.
* @param \Drupal\Core\Controller\ControllerResolver $controller_resolver
* The controller resolver service.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory service.
*/
public function __construct($root, ModuleHandler $module_handler, TranslationManager $string_translation, ControllerResolver $controller_resolver, ConfigFactoryInterface $config_factory) {
public function __construct($root, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory) {
$this->root = $root;
$this->moduleHandler = $module_handler;
$this->stringTranslation = $string_translation;
$this->controllerResolver = $controller_resolver;
$this->config = $config_factory->get('http_client_manager.settings');
$this->servicesApi = $this->getServicesApi();
}
......
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