function SwitchUserBlock::__construct

Same name in other branches
  1. 5.x src/Plugin/Block/SwitchUserBlock.php \Drupal\devel\Plugin\Block\SwitchUserBlock::__construct()

Constructs a new SwitchUserBlock object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\Session\AccountInterface $current_user: Current user.

\Drupal\Core\Entity\EntityStorageInterface $user_storage: The user storage.

\Drupal\Core\Form\FormBuilderInterface $form_builder: The form builder service.

Overrides BlockPluginTrait::__construct

File

src/Plugin/Block/SwitchUserBlock.php, line 69

Class

SwitchUserBlock
Provides a block for switching users.

Namespace

Drupal\devel\Plugin\Block

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, AccountInterface $current_user, EntityStorageInterface $user_storage, FormBuilderInterface $form_builder) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->formBuilder = $form_builder;
    $this->currentUser = $current_user;
    $this->userStorage = $user_storage;
}