Passed
Push — master ( 0c1729...0d09b8 )
by Daimona
02:21 queued 26s
created
includes/Message/Message.php 1 patch
Spacing   +10 added lines, -10 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\Message;
4 4
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	/**
24 24
 	 * @param string $value
25 25
 	 */
26
-	public function __construct( string $value ) {
26
+	public function __construct ( string $value ) {
27 27
 		$this->value = $value;
28 28
 	}
29 29
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	 * @param array $args
32 32
 	 * @return self
33 33
 	 */
34
-	public function params( array $args ) : self {
34
+	public function params ( array $args ) : self {
35 35
 		$this->value = strtr( $this->value, $args );
36 36
 		return $this;
37 37
 	}
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	/**
40 40
 	 * @return string
41 41
 	 */
42
-	public function text() : string {
42
+	public function text () : string {
43 43
 		$this->parsePlurals();
44 44
 		return $this->value;
45 45
 	}
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	/**
48 48
 	 * Replace {{$plur|<amount>|sing|plur}}
49 49
 	 */
50
-	protected function parsePlurals() : void {
50
+	protected function parsePlurals () : void {
51 51
 		$reg = '!\{\{\$plur\|(?P<amount>\d+)\|(?P<sing>[^}|]+)\|(?P<plur>[^|}]+)}}!';
52 52
 
53 53
 		if ( preg_match( $reg, $this->value ) === 0 ) {
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 		$this->value = preg_replace_callback(
57 57
 			$reg,
58 58
 			static function ( $matches ) {
59
-				return (int)$matches['amount'] > 1 ? trim( $matches['plur'] ) : trim( $matches['sing'] );
59
+				return (int)$matches[ 'amount' ] > 1 ? trim( $matches[ 'plur' ] ) : trim( $matches[ 'sing' ] );
60 60
 			},
61 61
 			$this->value
62 62
 		);
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 * @param string $timeString Full format, e.g. "15 aprile 2019 18:27"
69 69
 	 * @return int
70 70
 	 */
71
-	public static function getTimestampFromLocalTime( string $timeString ) : int {
71
+	public static function getTimestampFromLocalTime ( string $timeString ) : int {
72 72
 		$englishTime = str_ireplace(
73 73
 			array_values( self::MONTHS ),
74 74
 			array_keys( self::MONTHS ),
@@ -86,12 +86,12 @@  discard block
 block discarded – undo
86 86
 	 * @param string $emptyText
87 87
 	 * @return string
88 88
 	 */
89
-	public static function commaList( array $data, string $emptyText = 'nessuno' ) : string {
89
+	public static function commaList ( array $data, string $emptyText = 'nessuno' ) : string {
90 90
 		if ( count( $data ) > 1 ) {
91 91
 			$last = array_pop( $data );
92 92
 			$ret = implode( ', ', $data ) . " e $last";
93 93
 		} elseif ( $data ) {
94
-			$ret = (string)$data[0];
94
+			$ret = (string)$data[ 0 ];
95 95
 		} else {
96 96
 			$ret = $emptyText;
97 97
 		}
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 		return $ret;
100 100
 	}
101 101
 
102
-	public function __toString() {
102
+	public function __toString () {
103 103
 		return $this->text();
104 104
 	}
105 105
 }
Please login to merge, or discard this patch.
run.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare( strict_types=1 );
1
+<?php declare(strict_types=1);
2 2
 /**
3 3
  * Entry point for the bot, called by CLI
4 4
  */
Please login to merge, or discard this patch.
includes/Task/TaskBase.php 1 patch
Spacing   +7 added lines, -7 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
 
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
  */
16 16
 abstract class TaskBase extends ContextSource {
17 17
 	/** @var string[] */
18
-	protected $errors = [];
18
+	protected $errors = [ ];
19 19
 	/** @var TaskDataProvider */
20 20
 	protected $dataProvider;
21 21
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	 * @param MessageProvider $mp
29 29
 	 * @param PageBotList $pbl
30 30
 	 */
31
-	final public function __construct(
31
+	final public function __construct (
32 32
 		LoggerInterface $logger,
33 33
 		WikiGroup $wikiGroup,
34 34
 		TaskDataProvider $dataProvider,
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	 *
45 45
 	 * @return \BotRiconferme\TaskHelper\TaskResult
46 46
 	 */
47
-	final public function run() : TaskResult {
47
+	final public function run () : TaskResult {
48 48
 		$class = ( new \ReflectionClass( $this ) )->getShortName();
49 49
 		$opName = $this->getOperationName();
50 50
 		$this->getLogger()->info( "Starting $opName $class" );
@@ -75,19 +75,19 @@  discard block
 block discarded – undo
75 75
 	 *
76 76
 	 * @return int One of the STATUS_* constants
77 77
 	 */
78
-	abstract protected function runInternal() : int;
78
+	abstract protected function runInternal () : int;
79 79
 
80 80
 	/**
81 81
 	 * How this operation should be called in logs
82 82
 	 *
83 83
 	 * @return string
84 84
 	 */
85
-	abstract public function getOperationName() : string;
85
+	abstract public function getOperationName () : string;
86 86
 
87 87
 	/**
88 88
 	 * @return TaskDataProvider
89 89
 	 */
90
-	protected function getDataProvider() : TaskDataProvider {
90
+	protected function getDataProvider () : TaskDataProvider {
91 91
 		return $this->dataProvider;
92 92
 	}
93 93
 }
Please login to merge, or discard this patch.
includes/Bot.php 1 patch
Spacing   +11 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;
4 4
 
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	/**
34 34
 	 * @param CLI $cli
35 35
 	 */
36
-	public function __construct( CLI $cli ) {
36
+	public function __construct ( CLI $cli ) {
37 37
 		$this->cli = $cli;
38 38
 		$this->initialize();
39 39
 	}
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	/**
42 42
 	 * Initialize all members.
43 43
 	 */
44
-	private function initialize() : void {
44
+	private function initialize () : void {
45 45
 		$simpleLogger = new SimpleLogger();
46 46
 		$this->createWikiGroup( $simpleLogger );
47 47
 		$this->messageProvider = new MessageProvider(
@@ -55,14 +55,14 @@  discard block
 block discarded – undo
55 55
 	/**
56 56
 	 * Main entry point
57 57
 	 */
58
-	public function run() : void {
58
+	public function run () : void {
59 59
 		$taskOpt = $this->cli->getTaskOpt();
60 60
 		$type = current( array_keys( $taskOpt ) );
61 61
 		try {
62 62
 			if ( $type === 'task' ) {
63
-				$this->runInternal( TaskManager::MODE_TASK, $taskOpt['task'] );
63
+				$this->runInternal( TaskManager::MODE_TASK, $taskOpt[ 'task' ] );
64 64
 			} elseif ( $type === 'subtask' ) {
65
-				$this->runInternal( TaskManager::MODE_SUBTASK, $taskOpt['subtask'] );
65
+				$this->runInternal( TaskManager::MODE_SUBTASK, $taskOpt[ 'subtask' ] );
66 66
 			} else {
67 67
 				$this->runInternal();
68 68
 			}
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	/**
77 77
 	 * @param LoggerInterface $baseLogger
78 78
 	 */
79
-	private function createWikiGroup( LoggerInterface $baseLogger ) : void {
79
+	private function createWikiGroup ( LoggerInterface $baseLogger ) : void {
80 80
 		// FIXME Hardcoded
81 81
 		$url = $this->cli->getURL() ?? 'https://it.wikipedia.org/w/api.php';
82 82
 		$localUserIdentifier = '@itwiki';
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	 *
101 101
 	 * @param IFlushingAwareLogger $baseLogger
102 102
 	 */
103
-	private function createMainLogger( IFlushingAwareLogger $baseLogger ) : void {
103
+	private function createMainLogger ( IFlushingAwareLogger $baseLogger ) : void {
104 104
 		$mainWiki = $this->wikiGroup->getMainWiki();
105 105
 		$mp = $this->messageProvider;
106 106
 		$errTitle = $this->cli->getOpt( 'error-title' );
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	/**
128 128
 	 * Create the Config
129 129
 	 */
130
-	private function initConfig() : void {
130
+	private function initConfig () : void {
131 131
 		$wiki = $this->wikiGroup->getMainWiki();
132 132
 		try {
133 133
 			$confValues = json_decode( $wiki->getPageContent( $this->cli->getOpt( 'config-title' ) ), true );
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 	 * @param string $mode
145 145
 	 * @param string|null $name
146 146
 	 */
147
-	private function runInternal(
147
+	private function runInternal (
148 148
 		string $mode = TaskManager::MODE_COMPLETE,
149 149
 		string $name = null
150 150
 	) : void {
@@ -164,8 +164,7 @@  discard block
 block discarded – undo
164 164
 		$base = "Execution of $activity";
165 165
 		if ( $res->isOK() ) {
166 166
 			$msg = $res->getStatus() === TaskResult::STATUS_NOTHING ?
167
-				': nothing to do' :
168
-				' completed successfully';
167
+				': nothing to do' : ' completed successfully';
169 168
 			$this->mainLogger->info( $base . $msg );
170 169
 		} else {
171 170
 			$this->mainLogger->error( "$base failed.\n$res" );
Please login to merge, or discard this patch.
includes/Wiki/Page/PageRiconferma.php 1 patch
Spacing   +21 added lines, -21 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\Wiki\Page;
4 4
 
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	/** @var int */
15 15
 	private $opposeSection;
16 16
 	/** @var array Counts of votes for each section */
17
-	private $sectionCounts = [];
17
+	private $sectionCounts = [ ];
18 18
 
19 19
 	// Possible outcomes of a vote
20 20
 	public const OUTCOME_OK = 0;
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	 * because they can vary depending on whether the page is a vote, which is relatively
34 34
 	 * expensive to know since it requires parsing the content of the page.
35 35
 	 */
36
-	private function defineSections() : void {
36
+	private function defineSections () : void {
37 37
 		$this->supportSection = $this->isVote() ? 3 : 0;
38 38
 		$this->opposeSection = $this->isVote() ? 4 : 3;
39 39
 	}
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
 	 *
44 44
 	 * @return string
45 45
 	 */
46
-	public function getUserName() : string {
47
-		return explode( '/', $this->title )[2];
46
+	public function getUserName () : string {
47
+		return explode( '/', $this->title )[ 2 ];
48 48
 	}
49 49
 
50 50
 	/**
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 *
53 53
 	 * @return int
54 54
 	 */
55
-	public function getNum() : int {
55
+	public function getNum () : int {
56 56
 		$bits = explode( '/', $this->getTitle() );
57 57
 		return (int)end( $bits );
58 58
 	}
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 	 *
63 63
 	 * @return string
64 64
 	 */
65
-	public function getUserNum() : string {
66
-		return explode( '/', $this->getTitle(), 3 )[2];
65
+	public function getUserNum () : string {
66
+		return explode( '/', $this->getTitle(), 3 )[ 2 ];
67 67
 	}
68 68
 
69 69
 	/**
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 *
72 72
 	 * @return int
73 73
 	 */
74
-	public function getOpposingCount() : int {
74
+	public function getOpposingCount () : int {
75 75
 		$this->defineSections();
76 76
 		return $this->getCountForSection( $this->opposeSection );
77 77
 	}
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 * @return int
83 83
 	 * @throws \BadMethodCallException
84 84
 	 */
85
-	public function getSupportCount() : int {
85
+	public function getSupportCount () : int {
86 86
 		if ( !$this->isVote() ) {
87 87
 			throw new \BadMethodCallException( 'Cannot get support for a non-vote page.' );
88 88
 		}
@@ -96,13 +96,13 @@  discard block
 block discarded – undo
96 96
 	 * @param int $secNum
97 97
 	 * @return int
98 98
 	 */
99
-	protected function getCountForSection( int $secNum ) : int {
99
+	protected function getCountForSection ( int $secNum ) : int {
100 100
 		if ( !isset( $this->sectionCounts[ $secNum ] ) ) {
101 101
 			$content = $this->wiki->getPageContent( $this->title, $secNum );
102 102
 			// Let's hope that this is good enough...
103
-			$this->sectionCounts[$secNum] = preg_match_all( "/^# *(?![# *:]|\.\.\.$)/m", $content );
103
+			$this->sectionCounts[ $secNum ] = preg_match_all( "/^# *(?![# *:]|\.\.\.$)/m", $content );
104 104
 		}
105
-		return $this->sectionCounts[$secNum];
105
+		return $this->sectionCounts[ $secNum ];
106 106
 	}
107 107
 
108 108
 	/**
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
 	 *
111 111
 	 * @return int
112 112
 	 */
113
-	protected function getQuorum() : int {
113
+	protected function getQuorum () : int {
114 114
 		$reg = "!soddisfare il \[\[[^|\]]+\|quorum]] di '''(\d+) voti'''!";
115
-		return (int)$this->getMatch( $reg )[1];
115
+		return (int)$this->getMatch( $reg )[ 1 ];
116 116
 	}
117 117
 
118 118
 	/**
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	 *
121 121
 	 * @return bool
122 122
 	 */
123
-	public function hasOpposition() : bool {
123
+	public function hasOpposition () : bool {
124 124
 		return $this->getOpposingCount() >= self::REQUIRED_OPPOSE;
125 125
 	}
126 126
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	 *
130 130
 	 * @return int One of the OUTCOME_* constants
131 131
 	 */
132
-	public function getOutcome() : int {
132
+	public function getOutcome () : int {
133 133
 		if ( !$this->isVote() ) {
134 134
 			return self::OUTCOME_OK;
135 135
 		}
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	 * @throws \BadMethodCallException
153 153
 	 * @throws \LogicException
154 154
 	 */
155
-	public function getOutcomeText() : string {
155
+	public function getOutcomeText () : string {
156 156
 		if ( !$this->isVote() ) {
157 157
 			throw new \BadMethodCallException( 'No need for an outcome text.' );
158 158
 		}
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 	 *
187 187
 	 * @return bool
188 188
 	 */
189
-	public function isVote() : bool {
189
+	public function isVote () : bool {
190 190
 		$sectionReg = '/<!-- SEZIONE DA UTILIZZARE PER/';
191 191
 		return !$this->matches( $sectionReg );
192 192
 	}
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 	 *
197 197
 	 * @return int
198 198
 	 */
199
-	public function getCreationTimestamp() : int {
199
+	public function getCreationTimestamp () : int {
200 200
 		return $this->wiki->getPageCreationTS( $this->title );
201 201
 	}
202 202
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	 *
206 206
 	 * @return int
207 207
 	 */
208
-	public function getEndTimestamp() : int {
208
+	public function getEndTimestamp () : int {
209 209
 		if ( $this->isVote() ) {
210 210
 			$reg = "!La votazione ha inizio il.+ alle ore ([\d:]+) e ha termine il (.+) alla stessa ora!";
211 211
 			[ , $hours, $day ] = $this->getMatch( $reg );
Please login to merge, or discard this patch.
includes/Exception/BlockedException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare( strict_types=1 );
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace BotRiconferme\Exception;
4 4
 
Please login to merge, or discard this patch.
includes/Task/Subtask/FailedUpdates.php 1 patch
Spacing   +19 added lines, -19 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
 		$failed = $this->getFailures();
21 21
 		if ( !$failed ) {
22 22
 			return TaskResult::STATUS_NOTHING;
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
41 41
 	 *
42 42
 	 * @return PageRiconferma[]
43 43
 	 */
44
-	private function getFailures() : array {
45
-		$ret = [];
44
+	private function getFailures () : array {
45
+		$ret = [ ];
46 46
 		$allPages = $this->getDataProvider()->getPagesToClose();
47 47
 		foreach ( $allPages as $page ) {
48 48
 			if ( $page->getOutcome() & PageRiconferma::OUTCOME_FAIL ) {
49
-				$ret[] = $page;
49
+				$ret[ ] = $page;
50 50
 			}
51 51
 		}
52 52
 		return $ret;
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	/**
56 56
 	 * @param User[] $users
57 57
 	 */
58
-	protected function updateBurList( array $users ) : void {
58
+	protected function updateBurList ( array $users ) : void {
59 59
 		$this->getLogger()->info( 'Updating bur list. Removing: ' . implode( ', ', $users ) );
60 60
 		$remList = RegexUtils::regexFromArray( '!', ...$users );
61 61
 		$burList = $this->getPage( $this->getOpt( 'bur-list-title' ) );
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 *
79 79
 	 * @param PageRiconferma[] $pages
80 80
 	 */
81
-	protected function requestRemoval( array $pages ) : void {
81
+	protected function requestRemoval ( array $pages ) : void {
82 82
 		$this->getLogger()->info( 'Requesting flag removal for: ' . implode( ', ', $pages ) );
83 83
 
84 84
 		$metaWiki = $this->getWikiGroup()->getCentralWiki();
@@ -115,15 +115,15 @@  discard block
 block discarded – undo
115 115
 	 *
116 116
 	 * @param PageRiconferma[] $pages
117 117
 	 */
118
-	protected function updateAnnunci( array $pages ) : void {
118
+	protected function updateAnnunci ( array $pages ) : void {
119 119
 		$this->getLogger()->info( 'Updating annunci' );
120 120
 		$section = 1;
121 121
 
122
-		$names = [];
122
+		$names = [ ];
123 123
 		$text = '';
124 124
 		foreach ( $pages as $page ) {
125 125
 			$user = $page->getUserName();
126
-			$names[] = $user;
126
+			$names[ ] = $user;
127 127
 			$text .= $this->msg( 'annunci-text' )->params( [ '$user' => $user ] )->text();
128 128
 		}
129 129
 
@@ -155,16 +155,16 @@  discard block
 block discarded – undo
155 155
 	 *
156 156
 	 * @param PageRiconferma[] $pages
157 157
 	 */
158
-	protected function updateUltimeNotizie( array $pages ) : void {
158
+	protected function updateUltimeNotizie ( array $pages ) : void {
159 159
 		$this->getLogger()->info( 'Updating ultime notizie' );
160 160
 		$notiziePage = $this->getPage( $this->getOpt( 'ultimenotizie-page-title' ) );
161 161
 
162
-		$names = [];
162
+		$names = [ ];
163 163
 		$text = '';
164 164
 		$msg = $this->msg( 'ultimenotizie-text' );
165 165
 		foreach ( $pages as $page ) {
166 166
 			$user = $page->getUserName();
167
-			$names[] = $user;
167
+			$names[ ] = $user;
168 168
 			$text .= $msg->params( [ '$user' => $user, '$title' => $page->getTitle() ] )->text();
169 169
 		}
170 170
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	 *
193 193
 	 * @param PageRiconferma[] $pages
194 194
 	 */
195
-	protected function updateTimeline( array $pages ) : void {
195
+	protected function updateTimeline ( array $pages ) : void {
196 196
 		$this->getLogger()->info( 'Updating timeline' );
197 197
 		$timelinePage = $this->getPage( $this->getOpt( 'timeline-page-title' ) );
198 198
 		$content = $timelinePage->getContent();
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 	 *
221 221
 	 * @param PageRiconferma[] $pages
222 222
 	 */
223
-	private function updateCronologia( array $pages ) : void {
223
+	private function updateCronologia ( array $pages ) : void {
224 224
 		$this->getLogger()->info( 'Updating cronologia' );
225 225
 		$timelinePage = $this->getPage( $this->getOpt( 'cronologia-page-title' ) );
226 226
 		$content = $timelinePage->getContent();
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 	 *
248 248
 	 * @param PageRiconferma[] $pages
249 249
 	 */
250
-	private function blockOnPrivate( array $pages ) : void {
250
+	private function blockOnPrivate ( array $pages ) : void {
251 251
 		$this->getLogger()->info( 'Blocking on private wiki: ' . implode( ', ', $pages ) );
252 252
 
253 253
 		$privWiki = $this->getWikiGroup()->getPrivateWiki();
@@ -264,12 +264,12 @@  discard block
 block discarded – undo
264 264
 	 * @param PageRiconferma[] $pages
265 265
 	 * @return User[]
266 266
 	 */
267
-	private function getFailedBureaucrats( array $pages ) : array {
268
-		$ret = [];
267
+	private function getFailedBureaucrats ( array $pages ) : array {
268
+		$ret = [ ];
269 269
 		foreach ( $pages as $page ) {
270 270
 			$user = $this->getUser( $page->getUserName() );
271 271
 			if ( $user->inGroup( 'bureaucrat' ) ) {
272
-				$ret[] = $user;
272
+				$ret[ ] = $user;
273 273
 			}
274 274
 		}
275 275
 		return $ret;
Please login to merge, or discard this patch.
includes/Wiki/WikiGroup.php 1 patch
Spacing   +5 added lines, -5 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\Wiki;
4 4
 
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 * @param Wiki $centralWiki
19 19
 	 * @param Wiki $privateWiki
20 20
 	 */
21
-	public function __construct( Wiki $mainWiki, Wiki $centralWiki, Wiki $privateWiki ) {
21
+	public function __construct ( Wiki $mainWiki, Wiki $centralWiki, Wiki $privateWiki ) {
22 22
 		$this->mainWiki = $mainWiki;
23 23
 		$this->centralWiki = $centralWiki;
24 24
 		$this->privateWiki = $privateWiki;
@@ -27,21 +27,21 @@  discard block
 block discarded – undo
27 27
 	/**
28 28
 	 * @return Wiki
29 29
 	 */
30
-	public function getMainWiki() : Wiki {
30
+	public function getMainWiki () : Wiki {
31 31
 		return $this->mainWiki;
32 32
 	}
33 33
 
34 34
 	/**
35 35
 	 * @return Wiki
36 36
 	 */
37
-	public function getCentralWiki() : Wiki {
37
+	public function getCentralWiki () : Wiki {
38 38
 		return $this->centralWiki;
39 39
 	}
40 40
 
41 41
 	/**
42 42
 	 * @return Wiki
43 43
 	 */
44
-	public function getPrivateWiki() : Wiki {
44
+	public function getPrivateWiki () : Wiki {
45 45
 		return $this->privateWiki;
46 46
 	}
47 47
 }
Please login to merge, or discard this patch.
includes/Task/StartVote.php 1 patch
Spacing   +15 added lines, -15 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,15 +14,15 @@  discard block
 block discarded – undo
14 14
 	/**
15 15
 	 * @inheritDoc
16 16
 	 */
17
-	protected function getSubtasksMap(): array {
17
+	protected function getSubtasksMap (): array {
18 18
 		// Everything is done here.
19
-		return [];
19
+		return [ ];
20 20
 	}
21 21
 
22 22
 	/**
23 23
 	 * @inheritDoc
24 24
 	 */
25
-	public function runInternal() : int {
25
+	public function runInternal () : int {
26 26
 		$pages = $this->getDataProvider()->getOpenPages();
27 27
 
28 28
 		if ( !$pages ) {
@@ -36,13 +36,13 @@  discard block
 block discarded – undo
36 36
 	 * @param PageRiconferma[] $pages
37 37
 	 * @return int a STATUS_* constant
38 38
 	 */
39
-	protected function processPages( array $pages ) : int {
40
-		$donePages = [];
39
+	protected function processPages ( array $pages ) : int {
40
+		$donePages = [ ];
41 41
 		foreach ( $pages as $page ) {
42 42
 			if ( $page->hasOpposition() && !$page->isVote() ) {
43 43
 				$this->openVote( $page );
44 44
 				$this->updateBasePage( $page );
45
-				$donePages[] = $page;
45
+				$donePages[ ] = $page;
46 46
 			}
47 47
 		}
48 48
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 *
61 61
 	 * @param PageRiconferma $page
62 62
 	 */
63
-	protected function openVote( PageRiconferma $page ) : void {
63
+	protected function openVote ( PageRiconferma $page ) : void {
64 64
 		$this->getLogger()->info( "Starting vote on $page" );
65 65
 
66 66
 		$content = $page->getContent();
@@ -99,12 +99,12 @@  discard block
 block discarded – undo
99 99
 	 * @see SimpleUpdates::updateVotazioni()
100 100
 	 * @see OpenUpdates::addToVotazioni()
101 101
 	 */
102
-	protected function updateVotazioni( array $pages ) : void {
102
+	protected function updateVotazioni ( array $pages ) : void {
103 103
 		$votePage = $this->getPage( $this->getOpt( 'vote-page-title' ) );
104 104
 
105
-		$users = [];
105
+		$users = [ ];
106 106
 		foreach ( $pages as $page ) {
107
-			$users[] = $this->getUser( $page->getUserName() );
107
+			$users[ ] = $this->getUser( $page->getUserName() );
108 108
 		}
109 109
 		$usersReg = RegexUtils::regexFromArray( '!', ...$users );
110 110
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	 * @param PageRiconferma $page
139 139
 	 * @see \BotRiconferme\Task\Subtask\ClosePages::updateBasePage()
140 140
 	 */
141
-	protected function updateBasePage( PageRiconferma $page ) : void {
141
+	protected function updateBasePage ( PageRiconferma $page ) : void {
142 142
 		$this->getLogger()->info( "Updating base page for $page" );
143 143
 
144 144
 		if ( $page->getNum() === 1 ) {
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	 * @see SimpleUpdates::updateNews()
166 166
 	 * @see OpenUpdates::addToNews()
167 167
 	 */
168
-	protected function updateNews( int $amount ) : void {
168
+	protected function updateNews ( int $amount ) : void {
169 169
 		$this->getLogger()->info( "Turning $amount pages into votes" );
170 170
 		$newsPage = $this->getPage( $this->getOpt( 'news-page-title' ) );
171 171
 
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
 			throw new TaskException( 'Param "voto" not found in news page' );
181 181
 		}
182 182
 
183
-		$newTac = ( (int)$newsPage->getMatch( $regTac )[2] - $amount ) ?: '';
184
-		$newVot = ( (int)$newsPage->getMatch( $regVot )[2] + $amount ) ?: '';
183
+		$newTac = ( (int)$newsPage->getMatch( $regTac )[ 2 ] - $amount ) ?: '';
184
+		$newVot = ( (int)$newsPage->getMatch( $regVot )[ 2 ] + $amount ) ?: '';
185 185
 
186 186
 		$newContent = preg_replace( $regTac, '${1}' . $newTac, $content );
187 187
 		$newContent = preg_replace( $regVot, '${1}' . $newVot, $newContent );
Please login to merge, or discard this patch.