Passed
Push — master ( 13df7f...843e45 )
by Daimona
01:42
created
includes/Task/Subtask/CreatePages.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare( strict_types=1 );
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace BotRiconferme\Task\Subtask;
4 4
 
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 	/**
17 17
 	 * @inheritDoc
18 18
 	 */
19
-	public function runInternal() : int {
19
+	public function runInternal () : int {
20 20
 		$users = $this->getDataProvider()->getUsersToProcess();
21 21
 
22 22
 		if ( !$users ) {
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	 *
36 36
 	 * @param User $user
37 37
 	 */
38
-	protected function processUser( User $user ) {
38
+	protected function processUser ( User $user ) {
39 39
 		$this->getLogger()->info( "Processing user $user" );
40 40
 		try {
41 41
 			$num = $this->getLastPageNum( $user ) + 1;
@@ -70,14 +70,14 @@  discard block
 block discarded – undo
70 70
 	 * @return int
71 71
 	 * @throws TaskException
72 72
 	 */
73
-	protected function getLastPageNum( User $user ) : int {
73
+	protected function getLastPageNum ( User $user ) : int {
74 74
 		$this->getLogger()->debug( "Retrieving previous pages for $user" );
75 75
 
76
-		$unprefixedTitle = explode( ':', $this->getOpt( 'main-page-title' ), 2 )[1];
76
+		$unprefixedTitle = explode( ':', $this->getOpt( 'main-page-title' ), 2 )[ 1 ];
77 77
 
78 78
 		$prefixes = [ "$unprefixedTitle/$user/" ];
79 79
 		foreach ( $user->getAliases() as $alias ) {
80
-			$prefixes[] = "$unprefixedTitle/$alias/";
80
+			$prefixes[ ] = "$unprefixedTitle/$alias/";
81 81
 		}
82 82
 
83 83
 		$params = [
@@ -111,14 +111,14 @@  discard block
 block discarded – undo
111 111
 	 * @param string $title
112 112
 	 * @param User $user
113 113
 	 */
114
-	protected function createPage( string $title, User $user ) {
114
+	protected function createPage ( string $title, User $user ) {
115 115
 		$this->getLogger()->info( "Creating page $title" );
116 116
 		$groups = $user->getGroupsWithDates();
117 117
 		$textParams = [
118 118
 			'$user' => $user->getName(),
119
-			'$date' => $groups['sysop'],
120
-			'$burocrate' => $groups['bureaucrat'] ?? '',
121
-			'$checkuser' => $groups['checkuser'] ?? ''
119
+			'$date' => $groups[ 'sysop' ],
120
+			'$burocrate' => $groups[ 'bureaucrat' ] ?? '',
121
+			'$checkuser' => $groups[ 'checkuser' ] ?? ''
122 122
 		];
123 123
 
124 124
 		$params = [
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 	 * @param Page $basePage
137 137
 	 * @param string $newText
138 138
 	 */
139
-	protected function createBasePage( Page $basePage, string $newText ) {
139
+	protected function createBasePage ( Page $basePage, string $newText ) {
140 140
 		$this->getLogger()->info( "Creating base page $basePage" );
141 141
 
142 142
 		$params = [
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	 * @param Page $basePage
153 153
 	 * @param string $newText
154 154
 	 */
155
-	protected function updateBasePage( Page $basePage, string $newText ) {
155
+	protected function updateBasePage ( Page $basePage, string $newText ) {
156 156
 		$this->getLogger()->info( "Updating base page $basePage" );
157 157
 
158 158
 		$params = [
Please login to merge, or discard this patch.