Passed
Push — master ( e26f3b...6f3cd3 )
by Daimona
01:37
created
includes/PageRiconferma.php 1 patch
Spacing   +24 added lines, -24 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;
4 4
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 * @param string $title
30 30
 	 * @param WikiController $controller
31 31
 	 */
32
-	public function __construct( string $title, WikiController $controller ) {
32
+	public function __construct ( string $title, WikiController $controller ) {
33 33
 		$this->title = $title;
34 34
 		$this->controller = $controller;
35 35
 	}
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	/**
38 38
 	 * @return string
39 39
 	 */
40
-	public function getTitle() : string {
40
+	public function getTitle () : string {
41 41
 		return $this->title;
42 42
 	}
43 43
 
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 	 *
47 47
 	 * @return string
48 48
 	 */
49
-	public function getUser() : string {
50
-		return explode( '/', $this->title )[2];
49
+	public function getUser () : string {
50
+		return explode( '/', $this->title )[ 2 ];
51 51
 	}
52 52
 
53 53
 	/**
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	 *
56 56
 	 * @return int
57 57
 	 */
58
-	public function getNum() : int {
58
+	public function getNum () : int {
59 59
 		$bits = explode( '/', $this->getTitle() );
60 60
 		return intval( end( $bits ) );
61 61
 	}
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 	 *
66 66
 	 * @return string
67 67
 	 */
68
-	public function getUserNum() : string {
69
-		return explode( '/', $this->getTitle(), 3 )[2];
68
+	public function getUserNum () : string {
69
+		return explode( '/', $this->getTitle(), 3 )[ 2 ];
70 70
 	}
71 71
 
72 72
 	/**
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	 *
75 75
 	 * @return string
76 76
 	 */
77
-	public function getBaseTitle() : string {
77
+	public function getBaseTitle () : string {
78 78
 		// @phan-suppress-next-line PhanTypeMismatchArgumentInternal Phan bug
79 79
 		return substr( $this->getTitle(), 0, strrpos( $this->getTitle(), '/' ) );
80 80
 	}
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	 *
85 85
 	 * @return string
86 86
 	 */
87
-	public function getContent() : string {
87
+	public function getContent () : string {
88 88
 		if ( $this->content === null ) {
89 89
 			$this->content = $this->controller->getPageContent( $this->title );
90 90
 		}
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 *
97 97
 	 * @return int
98 98
 	 */
99
-	public function getOpposingCount() : int {
99
+	public function getOpposingCount () : int {
100 100
 		return $this->getCountForSection( self::SECTION_OPPOSE );
101 101
 	}
102 102
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 	 *
106 106
 	 * @return int
107 107
 	 */
108
-	public function getSupportCount() : int {
108
+	public function getSupportCount () : int {
109 109
 		return $this->getCountForSection( self::SECTION_SUPPORT );
110 110
 	}
111 111
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 	 * @param int $secNum
116 116
 	 * @return int
117 117
 	 */
118
-	protected function getCountForSection( int $secNum ) : int {
118
+	protected function getCountForSection ( int $secNum ) : int {
119 119
 		$params = [
120 120
 			'action' => 'query',
121 121
 			'prop' => 'revisions',
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
 		$res = RequestBase::newFromParams( $params )->execute();
129 129
 		$page = reset( $res->query->pages );
130
-		$content = $page->revisions[0]->slots->main->{ '*' };
130
+		$content = $page->revisions[ 0 ]->slots->main->{ '*' };
131 131
 		// Let's hope that this is good enough...
132 132
 		return substr_count( $content, "\n\# *(?![#*])" );
133 133
 	}
@@ -135,11 +135,11 @@  discard block
 block discarded – undo
135 135
 	/**
136 136
 	 * Gets the quorum used for the current page
137 137
 	 */
138
-	protected function getQuorum() : int {
138
+	protected function getQuorum () : int {
139 139
 		$reg = "!soddisfare il \[\[[^|\]]+\|quorum]] di '''(\d+) voti'''!";
140
-		$matches = [];
140
+		$matches = [ ];
141 141
 		preg_match( $reg, $this->getContent(), $matches );
142
-		return intval( $matches[1] );
142
+		return intval( $matches[ 1 ] );
143 143
 	}
144 144
 
145 145
 	/**
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 	 *
148 148
 	 * @return bool
149 149
 	 */
150
-	public function hasOpposition() : bool {
150
+	public function hasOpposition () : bool {
151 151
 		return $this->getOpposingCount() >= 15;
152 152
 	}
153 153
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @return int One of the OUTCOME_* constants
158 158
 	 * @throws \BadMethodCallException
159 159
 	 */
160
-	public function getOutcome() : int {
160
+	public function getOutcome () : int {
161 161
 		if ( !$this->isVote() ) {
162 162
 			throw new \BadMethodCallException( 'Cannot get outcome for a non-vote page.' );
163 163
 		}
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 	 * @return string
177 177
 	 * @throws \BadMethodCallException
178 178
 	 */
179
-	public function getOutcomeText() : string {
179
+	public function getOutcomeText () : string {
180 180
 		if ( !$this->isVote() ) {
181 181
 			throw new \BadMethodCallException( 'No need for an outcome text.' );
182 182
 		}
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 	 *
209 209
 	 * @return bool
210 210
 	 */
211
-	public function isVote() : bool {
211
+	public function isVote () : bool {
212 212
 		$sectionReg = '/<!-- SEZIONE DA UTILIZZARE PER/';
213 213
 		return preg_match( $sectionReg, $this->getContent() ) === false;
214 214
 	}
@@ -218,9 +218,9 @@  discard block
 block discarded – undo
218 218
 	 *
219 219
 	 * @return int
220 220
 	 */
221
-	public function getEndTimestamp() : int {
221
+	public function getEndTimestamp () : int {
222 222
 		if ( $this->isVote() ) {
223
-			$matches = [];
223
+			$matches = [ ];
224 224
 			$reg = "!La votazione ha inizio il.+ e ha termine.+ '''([^']+)''' alle ore '''([^']+)'''!";
225 225
 			preg_match( $reg, $this->getContent(), $matches );
226 226
 			list( , $day, $hours ) = $matches;
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 		}
233 233
 	}
234 234
 
235
-	public function __toString() {
235
+	public function __toString () {
236 236
 		return $this->getTitle();
237 237
 	}
238 238
 }
Please login to merge, or discard this patch.
includes/Task/StartVote.php 1 patch
Spacing   +17 added lines, -17 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;
4 4
 
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	/**
15 15
 	 * @inheritDoc
16 16
 	 */
17
-	public function run() : TaskResult {
17
+	public function run () : TaskResult {
18 18
 		$this->getLogger()->info( 'Starting task StartVote' );
19 19
 
20 20
 		$pages = $this->getDataProvider()->getOpenPages();
@@ -32,12 +32,12 @@  discard block
 block discarded – undo
32 32
 	/**
33 33
 	 * @param PageRiconferma[] $pages
34 34
 	 */
35
-	protected function processPages( array $pages ) {
36
-		$actualPages = [];
35
+	protected function processPages ( array $pages ) {
36
+		$actualPages = [ ];
37 37
 		foreach ( $pages as $page ) {
38 38
 			if ( $page->hasOpposition() && !$page->isVote() ) {
39 39
 				$this->openVote( $page );
40
-				$actualPages[] = $page;
40
+				$actualPages[ ] = $page;
41 41
 			}
42 42
 		}
43 43
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	 *
55 55
 	 * @param PageRiconferma $page
56 56
 	 */
57
-	protected function openVote( PageRiconferma $page ) {
57
+	protected function openVote ( PageRiconferma $page ) {
58 58
 		$this->getLogger()->info( "Starting vote on $page" );
59 59
 
60 60
 		$content = $page->getContent();
@@ -93,13 +93,13 @@  discard block
 block discarded – undo
93 93
 	 * @see ClosePages::updateVote()
94 94
 	 * @see UpdatesAround::addVote()
95 95
 	 */
96
-	protected function updateVotePage( array $pages ) {
96
+	protected function updateVotePage ( array $pages ) {
97 97
 		$votePage = $this->getConfig()->get( 'ric-vote-page' );
98 98
 		$content = $this->getController()->getPageContent( $votePage );
99 99
 
100
-		$titles = [];
100
+		$titles = [ ];
101 101
 		foreach ( $pages as $page ) {
102
-			$titles[] = preg_quote( $page->getTitle() );
102
+			$titles[ ] = preg_quote( $page->getTitle() );
103 103
 		}
104 104
 		$titleReg = implode( '|', $titles );
105 105
 		$search = "!^\*.+ La \[\[($titleReg)\|procedura]] termina.+\n!gm";
@@ -122,14 +122,14 @@  discard block
 block discarded – undo
122 122
 			$newContent = preg_replace( $introReg, '$0' . "\n$newLines", $newContent, 1 );
123 123
 		} else {
124 124
 			// Start section
125
-			$matches = [];
125
+			$matches = [ ];
126 126
 			if ( preg_match( $introReg, $content, $matches ) === false ) {
127 127
 				throw new TaskException( 'Intro not found in vote page' );
128 128
 			}
129 129
 			$beforeReg = '!INSERIRE LA NOTIZIA PIÙ NUOVA IN CIMA.+!m';
130 130
 			// Replace semicolon with full stop
131 131
 			$newLines = substr( $newLines, 0, -2 ) . ".\n";
132
-			$newContent = preg_replace( $beforeReg, '$0' . "\n{$matches[0]}\n$newLines", $newContent, 1 );
132
+			$newContent = preg_replace( $beforeReg, '$0' . "\n{$matches[ 0 ]}\n$newLines", $newContent, 1 );
133 133
 		}
134 134
 
135 135
 		$summary = strtr(
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 		$summary = preg_replace_callback(
140 140
 			'!\{\{$plur|(\d+)|([^|]+)|([^|]+)}}!',
141 141
 			function ( $matches ) {
142
-				return intval( $matches[1] ) > 1 ? trim( $matches[3] ) : trim( $matches[2] );
142
+				return intval( $matches[ 1 ] ) > 1 ? trim( $matches[ 3 ] ) : trim( $matches[ 2 ] );
143 143
 			},
144 144
 			$summary
145 145
 		);
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 	 * @see UpdatesAround::addNews()
161 161
 	 * @see ClosePages::updateNews()
162 162
 	 */
163
-	protected function updateNews( int $amount ) {
163
+	protected function updateNews ( int $amount ) {
164 164
 		$this->getLogger()->info( "Turning $amount pages into votes" );
165 165
 		$newsPage = $this->getConfig()->get( 'ric-news-page' );
166 166
 
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 		$regTac = '!(\| *riconferme[ _]tacite[ _]amministratori *= *)(\d+)!';
169 169
 		$regVot = '!(\| *riconferme[ _]voto[ _]amministratori *= *)(\d+)!';
170 170
 
171
-		$tacMatches = $votMatches = [];
171
+		$tacMatches = $votMatches = [ ];
172 172
 		if ( preg_match( $regTac, $content, $tacMatches ) === false ) {
173 173
 			throw new TaskException( 'Param "tacite" not found in news page' );
174 174
 		}
@@ -176,8 +176,8 @@  discard block
 block discarded – undo
176 176
 			throw new TaskException( 'Param "voto" not found in news page' );
177 177
 		}
178 178
 
179
-		$newTac = (int)$tacMatches[2] - $amount ?: '';
180
-		$newVot = (int)$votMatches[2] + $amount ?: '';
179
+		$newTac = (int)$tacMatches[ 2 ] - $amount ?: '';
180
+		$newVot = (int)$votMatches[ 2 ] + $amount ?: '';
181 181
 
182 182
 		$newContent = preg_replace( $regTac, '${1}' . $newTac, $content );
183 183
 		$newContent = preg_replace( $regVot, '${1}' . $newVot, $newContent );
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 		$summary = preg_replace_callback(
190 190
 			'!\{\{$plur|(\d+)|([^|]+)|([^|]+)}}!',
191 191
 			function ( $matches ) {
192
-				return intval( $matches[1] ) > 1 ? trim( $matches[3] ) : trim( $matches[2] );
192
+				return intval( $matches[ 1 ] ) > 1 ? trim( $matches[ 3 ] ) : trim( $matches[ 2 ] );
193 193
 			},
194 194
 			$summary
195 195
 		);
Please login to merge, or discard this patch.
includes/Task/ClosePages.php 1 patch
Spacing   +33 added lines, -34 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;
4 4
 
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	/**
15 15
 	 * @inheritDoc
16 16
 	 */
17
-	public function run() : TaskResult {
17
+	public function run () : TaskResult {
18 18
 		$this->getLogger()->info( 'Starting task ClosePages' );
19 19
 
20 20
 		$pages = $this->getPagesList();
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
 	 *
43 43
 	 * @return PageRiconferma[]
44 44
 	 */
45
-	protected function getPagesList() : array {
45
+	protected function getPagesList () : array {
46 46
 		$allPages = $this->getDataProvider()->getOpenPages();
47
-		$ret = [];
47
+		$ret = [ ];
48 48
 		foreach ( $allPages as $page ) {
49 49
 			if ( time() > $page->getEndTimestamp() ) {
50
-				$ret[] = $page;
50
+				$ret[ ] = $page;
51 51
 			}
52 52
 		}
53 53
 		return $ret;
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	/**
57 57
 	 * @param PageRiconferma $page
58 58
 	 */
59
-	protected function addVoteCloseText( PageRiconferma $page ) {
59
+	protected function addVoteCloseText ( PageRiconferma $page ) {
60 60
 		$content = $page->getContent();
61 61
 		$beforeReg = '!è necessario ottenere una maggioranza .+ votanti\.!';
62 62
 		$newContent = preg_replace( $beforeReg, '$0' . "\n" . $page->getOutcomeText(), $content );
@@ -75,14 +75,14 @@  discard block
 block discarded – undo
75 75
 	 * @param PageRiconferma[] $pages
76 76
 	 * @see UpdatesAround::addToMainPage()
77 77
 	 */
78
-	protected function removeFromMainPage( array $pages ) {
78
+	protected function removeFromMainPage ( array $pages ) {
79 79
 		$this->getLogger()->info(
80 80
 			'Removing from main: ' . implode( ', ', array_map( 'strval', $pages ) )
81 81
 		);
82 82
 
83 83
 		$mainPage = $this->getConfig()->get( 'ric-main-page' );
84 84
 		$content = $this->getController()->getPageContent( $mainPage );
85
-		$translations = [];
85
+		$translations = [ ];
86 86
 		foreach ( $pages as $page ) {
87 87
 			$translations[ '{{' . $page->getTitle() . '}}' ] = '';
88 88
 		}
@@ -100,17 +100,17 @@  discard block
 block discarded – undo
100 100
 	 *
101 101
 	 * @param PageRiconferma[] $pages
102 102
 	 */
103
-	protected function addToArchive( array $pages ) {
103
+	protected function addToArchive ( array $pages ) {
104 104
 		$this->getLogger()->info(
105 105
 			'Adding to archive: ' . implode( ', ', array_map( 'strval', $pages ) )
106 106
 		);
107 107
 
108
-		$simple = $votes = [];
108
+		$simple = $votes = [ ];
109 109
 		foreach ( $pages as $page ) {
110 110
 			if ( $page->isVote() ) {
111
-				$votes[] = $page;
111
+				$votes[ ] = $page;
112 112
 			} else {
113
-				$simple[] = $page;
113
+				$simple[ ] = $page;
114 114
 			}
115 115
 		}
116 116
 
@@ -127,21 +127,21 @@  discard block
 block discarded – undo
127 127
 	 * @param string $archiveTitle
128 128
 	 * @param array $pages
129 129
 	 */
130
-	private function reallyAddToArchive( string $archiveTitle, array $pages ) {
130
+	private function reallyAddToArchive ( string $archiveTitle, array $pages ) {
131 131
 		$curTitle = "$archiveTitle/" . date( 'Y' );
132 132
 
133 133
 		$append = '';
134
-		$archivedList = [];
134
+		$archivedList = [ ];
135 135
 		foreach ( $pages as $page ) {
136 136
 			$append .= '{{' . $page->getTitle() . "}}\n";
137
-			$archivedList[] = $page->getUserNum();
137
+			$archivedList[ ] = $page->getUserNum();
138 138
 		}
139 139
 
140 140
 		if ( count( $archivedList ) > 1 ) {
141 141
 			$last = array_pop( $archivedList );
142 142
 			$userNums = implode( ', ', $archivedList ) . " e $last";
143 143
 		} else {
144
-			$userNums = $archivedList[0];
144
+			$userNums = $archivedList[ 0 ];
145 145
 		}
146 146
 
147 147
 		$summary = strtr(
@@ -162,14 +162,13 @@  discard block
 block discarded – undo
162 162
 	 * @param PageRiconferma $page
163 163
 	 * @see CreatePages::updateBasePage()
164 164
 	 */
165
-	protected function updateBasePage( PageRiconferma $page ) {
165
+	protected function updateBasePage ( PageRiconferma $page ) {
166 166
 		$this->getLogger()->info( "Updating base page for $page" );
167 167
 
168 168
 		$current = $this->getController()->getPageContent( $page->getBaseTitle() );
169 169
 
170 170
 		$text = $page->isVote() ?
171
-			'votazione: ' . ( $page->getOutcome() & PageRiconferma::OUTCOME_FAIL ? 'non riconfermato' : 'riconfermato' ) :
172
-			'riconferma tacita';
171
+			'votazione: ' . ( $page->getOutcome() & PageRiconferma::OUTCOME_FAIL ? 'non riconfermato' : 'riconfermato' ) : 'riconferma tacita';
173 172
 
174 173
 		$newContent = str_replace( 'riconferma in corso', $text, $current );
175 174
 		$params = [
@@ -185,13 +184,13 @@  discard block
 block discarded – undo
185 184
 	 * @param PageRiconferma[] $pages
186 185
 	 * @see UpdatesAround::addVote()
187 186
 	 */
188
-	protected function updateVote( array $pages ) {
187
+	protected function updateVote ( array $pages ) {
189 188
 		$votePage = $this->getConfig()->get( 'ric-vote-page' );
190 189
 		$content = $this->getController()->getPageContent( $votePage );
191 190
 
192
-		$titles = [];
191
+		$titles = [ ];
193 192
 		foreach ( $pages as $page ) {
194
-			$titles[] = preg_quote( $page->getTitle() );
193
+			$titles[ ] = preg_quote( $page->getTitle() );
195 194
 		}
196 195
 
197 196
 		$titleReg = implode( '|', $titles );
@@ -214,7 +213,7 @@  discard block
 block discarded – undo
214 213
 		$summary = preg_replace_callback(
215 214
 			'!\{\{$plur|(\d+)|([^|]+)|([^|]+)}}!',
216 215
 			function ( $matches ) {
217
-				return intval( $matches[1] ) > 1 ? trim( $matches[3] ) : trim( $matches[2] );
216
+				return intval( $matches[ 1 ] ) > 1 ? trim( $matches[ 3 ] ) : trim( $matches[ 2 ] );
218 217
 			},
219 218
 			$summary
220 219
 		);
@@ -232,7 +231,7 @@  discard block
 block discarded – undo
232 231
 	 * @param array $pages
233 232
 	 * @see UpdatesAround::addNews()
234 233
 	 */
235
-	protected function updateNews( array $pages ) {
234
+	protected function updateNews ( array $pages ) {
236 235
 		$simpleAmount = $voteAmount = 0;
237 236
 		foreach ( $pages as $page ) {
238 237
 			if ( $page->isVote() ) {
@@ -249,12 +248,12 @@  discard block
 block discarded – undo
249 248
 		$simpleReg = '!(\| *riconferme[ _]tacite[ _]amministratori *= *)(\d+)!';
250 249
 		$voteReg = '!(\| *riconferme[ _]voto[ _]amministratori *= *)(\d+)!';
251 250
 
252
-		$simpleMatches = $voteMatched = [];
251
+		$simpleMatches = $voteMatched = [ ];
253 252
 		preg_match( $simpleReg, $content, $simpleMatches );
254 253
 		preg_match( $voteReg, $content, $voteMatches );
255 254
 
256
-		$newSimp = (int)$simpleMatches[2] - $simpleAmount ?: '';
257
-		$newVote = (int)$voteMatches[2] - $voteAmount ?: '';
255
+		$newSimp = (int)$simpleMatches[ 2 ] - $simpleAmount ?: '';
256
+		$newVote = (int)$voteMatches[ 2 ] - $voteAmount ?: '';
258 257
 		$newContent = preg_replace( $simpleReg, '${1}' . $newSimp, $content );
259 258
 		$newContent = preg_replace( $voteReg, '${1}' . $newVote, $newContent );
260 259
 
@@ -265,7 +264,7 @@  discard block
 block discarded – undo
265 264
 		$summary = preg_replace_callback(
266 265
 			'!\{\{$plur|(\d+)|([^|]+)|([^|]+)}}!',
267 266
 			function ( $matches ) {
268
-				return intval( $matches[1] ) > 1 ? trim( $matches[3] ) : trim( $matches[2] );
267
+				return intval( $matches[ 1 ] ) > 1 ? trim( $matches[ 3 ] ) : trim( $matches[ 2 ] );
269 268
 			},
270 269
 			$summary
271 270
 		);
@@ -284,22 +283,22 @@  discard block
 block discarded – undo
284 283
 	 *
285 284
 	 * @param PageRiconferma[] $pages
286 285
 	 */
287
-	protected function updateAdminList( array $pages ) {
286
+	protected function updateAdminList ( array $pages ) {
288 287
 		$listTitle = $this->getConfig()->get( 'admins-list' );
289 288
 		$newContent = $this->getController()->getPageContent( $listTitle );
290 289
 		$newDate = date( 'Ymd', strtotime( '+1 year' ) );
291 290
 
292
-		$riconfNames = $removeNames = [];
291
+		$riconfNames = $removeNames = [ ];
293 292
 		foreach ( $pages as $page ) {
294 293
 			$user = $page->getUser();
295 294
 			$reg = "!(\{\{Amministratore\/riga\|$user.+\| *)\d+( *\|(?: *pausa)? *\}\}\n)!";
296 295
 			if ( $page->getOutcome() & PageRiconferma::OUTCOME_FAIL ) {
297 296
 				// Remove the line
298 297
 				$newContent = preg_replace( $reg, '', $newContent );
299
-				$removeNames[] = $user;
298
+				$removeNames[ ] = $user;
300 299
 			} else {
301 300
 				$newContent = preg_replace( $reg, '$1' . $newDate . '$2', $newContent );
302
-				$riconfNames[] = $user;
301
+				$riconfNames[ ] = $user;
303 302
 			}
304 303
 		}
305 304
 
@@ -308,7 +307,7 @@  discard block
 block discarded – undo
308 307
 			$lastUser = array_pop( $riconfNames );
309 308
 			$riconfList = implode( ', ', $riconfNames ) . " e $lastUser";
310 309
 		} elseif ( $riconfNames ) {
311
-			$riconfList = $riconfNames[0];
310
+			$riconfList = $riconfNames[ 0 ];
312 311
 		} else {
313 312
 			$riconfList = 'nessuno';
314 313
 		}
@@ -317,7 +316,7 @@  discard block
 block discarded – undo
317 316
 			$lastUser = array_pop( $removeNames );
318 317
 			$removeList = implode( ', ', $removeNames ) . " e $lastUser";
319 318
 		} elseif ( $removeNames ) {
320
-			$removeList = $removeNames[0];
319
+			$removeList = $removeNames[ 0 ];
321 320
 		} else {
322 321
 			$removeList = 'nessuno';
323 322
 		}
Please login to merge, or discard this patch.