Skip to content

Commit

Permalink
Reintroduce the $user variable in the annotation business.
Browse files Browse the repository at this point in the history
Accidentally dropped it when moving to the other manner of declaring
properties via the constructor.
  • Loading branch information
adam-vessey committed Jan 16, 2024
1 parent 723e5d6 commit a9017b3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Drush/Commands/UserWrapperCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Consolidation\AnnotatedCommand\CommandError;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Session\AccountSwitcherInterface;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
Expand All @@ -26,6 +27,13 @@ class UserWrapperCommands implements LoggerAwareInterface, ContainerInjectionInt

use LoggerAwareTrait;

/**
* The user.
*
* @var \Drupal\Core\Session\AccountInterface|false
*/
protected AccountInterface|false $user = FALSE;

/**
* Constructor.
*/
Expand Down Expand Up @@ -137,6 +145,7 @@ public function unswitch($result, CommandData $commandData) {
$this->logDebug('to switch back');
$this->switcher->switchBack();
$this->logDebug('switched back');
$this->user = FALSE;
}

return $result;
Expand Down

0 comments on commit a9017b3

Please sign in to comment.