Skip to content
Snippets Groups Projects
Commit 5b83a4ed authored by Alvaro Hurtado's avatar Alvaro Hurtado
Browse files

use interfaces in dependency injection

parent 61ec403a
No related branches found
No related tags found
1 merge request!11414Issue #2699565: Replace \Drupal:: with $this->container->get() in test classes of Basic Auth module
......@@ -4,9 +4,8 @@
namespace Drupal\basic_auth_test;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\PageCache\ResponsePolicyInterface;
use Drupal\Core\State\StateInterface;
use Drupal\Core\PageCache\ResponsePolicy\KillSwitch;
/**
* Provides routes for HTTP Basic Authentication testing.
......@@ -23,7 +22,7 @@ class BasicAuthTestController {
/**
* The page cache kill switch service.
*
* @var \Drupal\Core\PageCache\ResponsePolicy\KillSwitch
* @var \Drupal\Core\PageCache\ResponsePolicy\ResponsePolicyInterface
*/
private $pageCacheKillSwitch;
......@@ -32,10 +31,10 @@ class BasicAuthTestController {
*
* @param \Drupal\Core\State\StateInterface $state
* The state storage service.
* @param \Drupal\Core\PageCache\ResponsePolicy\KillSwitch $pageCacheKillSwitch
* @param \Drupal\Core\PageCache\ResponsePolicy\ResponsePolicyInterface $pageCacheKillSwitch
* The page cache kill switch service.
*/
public function __construct(StateInterface $state, KillSwitch $pageCacheKillSwitch) {
public function __construct(StateInterface $state, ResponsePolicyInterface $pageCacheKillSwitch) {
$this->state = $state;
$this->pageCacheKillSwitch = $pageCacheKillSwitch;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment