Skip to content

Commit 2a9a32e

Browse files
committed
phpcs fixes
1 parent 02b2c19 commit 2a9a32e

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

drush.services.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ services:
77
- '@oit.teamsalert'
88
- '@database'
99
- '@oit.userclean'
10+
- '@oit.toppages'
1011
tags:
1112
- { name: drush.command }

src/Commands/OitCommands.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Drupal\servicenow\Plugin\PrincessList;
77
use Drush\Commands\DrushCommands;
88
use Drupal\oit\Plugin\TeamsAlert;
9+
use Drupal\oit\Plugin\TopPages;
910
use Drupal\Core\Database\Connection;
1011
use Drupal\oit\Plugin\Util\UserClean;
1112

@@ -45,10 +46,17 @@ class OitCommands extends DrushCommands {
4546
/**
4647
* User Clean.
4748
*
48-
* @var \Drupal\oit\Plugin\UserClean
49+
* @var \Drupal\oit\Plugin\Util\UserClean
4950
*/
5051
protected $userClean;
5152

53+
/**
54+
* Top Pages.
55+
*
56+
* @var \Drupal\oit\Plugin\TopPages
57+
*/
58+
protected $topPages;
59+
5260
/**
5361
* Construct object.
5462
*/
@@ -58,13 +66,15 @@ public function __construct(
5866
TeamsAlert $teams_alert,
5967
Connection $database,
6068
UserClean $user_clean,
69+
TopPages $top_pages,
6170
) {
6271
parent::__construct();
6372
$this->princessList = $princess_list;
6473
$this->messenger = $messenger;
6574
$this->teamsAlert = $teams_alert;
6675
$this->database = $database;
6776
$this->userClean = $user_clean;
77+
$this->topPages = $top_pages;
6878
}
6979

7080
/**
@@ -162,8 +172,7 @@ public function cleanUsers($limit = 0) {
162172
* @aliases oit:tsp
163173
*/
164174
public function topServicePages() {
165-
$toppages = \Drupal::service('oit.toppages');
166-
$toppages->getTopPages();
175+
$this->topPages->getTopPages();
167176
}
168177

169178
/**
@@ -173,8 +182,7 @@ public function topServicePages() {
173182
* @aliases oit:ttp
174183
*/
175184
public function topTutorialPages() {
176-
$toppages = \Drupal::service('oit.toppages');
177-
$toppages->getTopTutorials();
185+
$this->topPages->getTopTutorials();
178186
}
179187

180188
}

0 commit comments

Comments
 (0)