Passed
Push — master ( a45d4a...1801c5 )
by Daimona
01:34
created
includes/Task/Subtask/ArchivePages.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
 
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	/**
15 15
 	 * @inheritDoc
16 16
 	 */
17
-	public function runInternal() : int {
17
+	public function runInternal () : int {
18 18
 		$pages = $this->getDataProvider()->getPagesToClose();
19 19
 
20 20
 		if ( !$pages ) {
@@ -33,15 +33,15 @@  discard block
 block discarded – undo
33 33
 	 * @param PageRiconferma[] $pages
34 34
 	 * @see UpdatesAround::addToMainPage()
35 35
 	 */
36
-	protected function removeFromMainPage( array $pages ) {
36
+	protected function removeFromMainPage ( array $pages ) {
37 37
 		$this->getLogger()->info(
38 38
 			'Removing from main: ' . implode( ', ', array_map( 'strval', $pages ) )
39 39
 		);
40 40
 
41 41
 		$mainPage = new Page( $this->getConfig()->get( 'ric-main-page' ) );
42
-		$remove = [];
42
+		$remove = [ ];
43 43
 		foreach ( $pages as $page ) {
44
-			$remove[] = '{{' . $page->getTitle() . '}}';
44
+			$remove[ ] = '{{' . $page->getTitle() . '}}';
45 45
 		}
46 46
 
47 47
 		$mainPage->edit( [
@@ -55,17 +55,17 @@  discard block
 block discarded – undo
55 55
 	 *
56 56
 	 * @param PageRiconferma[] $pages
57 57
 	 */
58
-	protected function addToArchive( array $pages ) {
58
+	protected function addToArchive ( array $pages ) {
59 59
 		$this->getLogger()->info(
60 60
 			'Adding to archive: ' . implode( ', ', array_map( 'strval', $pages ) )
61 61
 		);
62 62
 
63
-		$simple = $votes = [];
63
+		$simple = $votes = [ ];
64 64
 		foreach ( $pages as $page ) {
65 65
 			if ( $page->isVote() ) {
66
-				$votes[] = $page;
66
+				$votes[ ] = $page;
67 67
 			} else {
68
-				$simple[] = $page;
68
+				$simple[ ] = $page;
69 69
 			}
70 70
 		}
71 71
 
@@ -82,14 +82,14 @@  discard block
 block discarded – undo
82 82
 	 * @param string $archiveTitle
83 83
 	 * @param array $pages
84 84
 	 */
85
-	private function reallyAddToArchive( string $archiveTitle, array $pages ) {
85
+	private function reallyAddToArchive ( string $archiveTitle, array $pages ) {
86 86
 		$archivePage = new Page( "$archiveTitle/" . date( 'Y' ) );
87 87
 
88 88
 		$append = '';
89
-		$archivedList = [];
89
+		$archivedList = [ ];
90 90
 		foreach ( $pages as $page ) {
91 91
 			$append .= '{{' . $page->getTitle() . "}}\n";
92
-			$archivedList[] = $page->getUserNum();
92
+			$archivedList[ ] = $page->getUserNum();
93 93
 		}
94 94
 
95 95
 		$summary = $this->msg( 'close-archive-summary' )
Please login to merge, or discard this patch.
includes/Task/Subtask/SimpleUpdates.php 1 patch
Spacing   +16 added lines, -16 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
 
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	/**
15 15
 	 * @inheritDoc
16 16
 	 */
17
-	public function runInternal() : int {
17
+	public function runInternal () : int {
18 18
 		$pages = $this->getDataProvider()->getPagesToClose();
19 19
 
20 20
 		if ( !$pages ) {
@@ -33,15 +33,15 @@  discard block
 block discarded – undo
33 33
 	 * @param PageRiconferma[] $pages
34 34
 	 * @see UpdatesAround::addVote()
35 35
 	 */
36
-	protected function updateVote( array $pages ) {
36
+	protected function updateVote ( array $pages ) {
37 37
 		$this->getLogger()->info(
38 38
 			'Updating votazioni: ' . implode( ', ', array_map( 'strval', $pages ) )
39 39
 		);
40 40
 		$votePage = new Page( $this->getConfig()->get( 'ric-vote-page' ) );
41 41
 
42
-		$titles = [];
42
+		$titles = [ ];
43 43
 		foreach ( $pages as $page ) {
44
-			$titles[] = preg_quote( $page->getTitle() );
44
+			$titles[ ] = preg_quote( $page->getTitle() );
45 45
 		}
46 46
 
47 47
 		$titleReg = implode( '|', $titles );
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 * @param array $pages
71 71
 	 * @see UpdatesAround::addNews()
72 72
 	 */
73
-	protected function updateNews( array $pages ) {
73
+	protected function updateNews ( array $pages ) {
74 74
 		$simpleAmount = $voteAmount = 0;
75 75
 		foreach ( $pages as $page ) {
76 76
 			if ( $page->isVote() ) {
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
 		$simpleMatches = $newsPage->getMatch( $simpleReg );
94 94
 		$voteMatches = $newsPage->getMatch( $voteReg );
95 95
 
96
-		$newSimp = (int)$simpleMatches[2] - $simpleAmount ?: '';
97
-		$newVote = (int)$voteMatches[2] - $voteAmount ?: '';
96
+		$newSimp = (int)$simpleMatches[ 2 ] - $simpleAmount ?: '';
97
+		$newVote = (int)$voteMatches[ 2 ] - $voteAmount ?: '';
98 98
 		$newContent = preg_replace( $simpleReg, '${1}' . $newSimp, $content );
99 99
 		$newContent = preg_replace( $voteReg, '${1}' . $newVote, $newContent );
100 100
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 	 *
113 113
 	 * @param PageRiconferma[] $pages
114 114
 	 */
115
-	protected function updateAdminList( array $pages ) {
115
+	protected function updateAdminList ( array $pages ) {
116 116
 		$this->getLogger()->info(
117 117
 			'Updating admin list: ' . implode( ', ', array_map( 'strval', $pages ) )
118 118
 		);
@@ -120,17 +120,17 @@  discard block
 block discarded – undo
120 120
 		$newContent = $adminsPage->getContent();
121 121
 		$newDate = date( 'Ymd', strtotime( '+1 year' ) );
122 122
 
123
-		$riconfNames = $removeNames = [];
123
+		$riconfNames = $removeNames = [ ];
124 124
 		foreach ( $pages as $page ) {
125 125
 			$user = $page->getUser();
126 126
 			$reg = "!(\{\{Amministratore\/riga\|$user.+\| *)\d+( *\|(?: *pausa)? *\}\}\n)!";
127 127
 			if ( $page->getOutcome() & PageRiconferma::OUTCOME_FAIL ) {
128 128
 				// Remove the line
129 129
 				$newContent = preg_replace( $reg, '', $newContent );
130
-				$removeNames[] = $user;
130
+				$removeNames[ ] = $user;
131 131
 			} else {
132 132
 				$newContent = preg_replace( $reg, '$1' . $newDate . '$2', $newContent );
133
-				$riconfNames[] = $user;
133
+				$riconfNames[ ] = $user;
134 134
 			}
135 135
 		}
136 136
 
@@ -150,13 +150,13 @@  discard block
 block discarded – undo
150 150
 	/**
151 151
 	 * @param PageRiconferma[] $pages
152 152
 	 */
153
-	protected function updateCUList( array $pages ) {
153
+	protected function updateCUList ( array $pages ) {
154 154
 		$this->getLogger()->info( 'Checking if CU list needs updating.' );
155 155
 		$cuList = new Page( $this->getConfig()->get( 'cu-list-title' ) );
156 156
 		$admins = $this->getDataProvider()->getUsersList();
157 157
 		$newContent = $cuList->getContent();
158 158
 
159
-		$riconfNames = $removeNames = [];
159
+		$riconfNames = $removeNames = [ ];
160 160
 		foreach ( $pages as $page ) {
161 161
 			$user = $page->getUser();
162 162
 			if ( array_key_exists( 'checkuser', $admins[ $user ] ) ) {
@@ -164,10 +164,10 @@  discard block
 block discarded – undo
164 164
 				if ( $page->getOutcome() & PageRiconferma::OUTCOME_FAIL ) {
165 165
 					// Remove the line
166 166
 					$newContent = preg_replace( $reg, '', $newContent );
167
-					$removeNames[] = $user;
167
+					$removeNames[ ] = $user;
168 168
 				} else {
169 169
 					$newContent = preg_replace( $reg, '$1{{subst:#time:j F Y}}$2', $newContent );
170
-					$riconfNames[] = $user;
170
+					$riconfNames[ ] = $user;
171 171
 				}
172 172
 			}
173 173
 		}
Please login to merge, or discard this patch.