Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion drush.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ services:
oit.commands:
class: \Drupal\oit\Commands\OitCommands
arguments:
- '@servicenow.princess.list'
- '@messenger'
- '@oit.teamsalert'
- '@database'
Expand Down
38 changes: 0 additions & 38 deletions src/Commands/OitCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Drupal\oit\Commands;

use Drupal\Core\Messenger\MessengerInterface;
use Drupal\servicenow\Plugin\PrincessList;
use Drush\Commands\DrushCommands;
use Drupal\oit\Plugin\TeamsAlert;
use Drupal\oit\Plugin\TopPages;
Expand All @@ -15,13 +14,6 @@
*/
class OitCommands extends DrushCommands {

/**
* Princess List.
*
* @var \Drupal\servicenow\Plugin\PrincessList
*/
protected $princessList;

/**
* The Messenger service.
*
Expand Down Expand Up @@ -61,50 +53,20 @@ class OitCommands extends DrushCommands {
* Construct object.
*/
public function __construct(
PrincessList $princess_list,
MessengerInterface $messenger,
TeamsAlert $teams_alert,
Connection $database,
UserClean $user_clean,
TopPages $top_pages,
) {
parent::__construct();
$this->princessList = $princess_list;
$this->messenger = $messenger;
$this->teamsAlert = $teams_alert;
$this->database = $database;
$this->userClean = $user_clean;
$this->topPages = $top_pages;
}

/**
* Rebuild Princess List.
*
* @command oit:reload-princess
* @aliases oit:rp
*/
public function reloadPrincess() {
$this->princessList->reload();
$this->messenger->addMessage('Princess List reloaded.');
}

/**
* Load Princess List.
*
* @param bool $incremental
* Set to 1 or 0 to incrementally load.
*
* @usage oit:lp 1
* Loads users into princess list incrementally.
*
* @command oit:load-princess
* @aliases oit:lp
*/
public function loadPrincess($incremental = 0) {
$this->princessList->cron($incremental);
$this->messenger->addMessage('Princess List Loaded.');
}

/**
* Send Teams Alert.
*
Expand Down
Loading