Passed
Push — master ( 0c1729...0d09b8 )
by Daimona
02:21 queued 26s
created
includes/Request/RequestFactory.php 1 patch
Spacing   +3 added lines, -3 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\Request;
4 4
 
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 	/**
10 10
 	 * @param string $domain
11 11
 	 */
12
-	public function __construct( string $domain ) {
12
+	public function __construct ( string $domain ) {
13 13
 		$this->domain = $domain;
14 14
 	}
15 15
 
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	 * @param array $params
18 18
 	 * @return RequestBase
19 19
 	 */
20
-	public function newFromParams( array $params ) : RequestBase {
20
+	public function newFromParams ( array $params ) : RequestBase {
21 21
 		if ( extension_loaded( 'curl' ) ) {
22 22
 			$ret = new CurlRequest( $params, $this->domain );
23 23
 		} else {
Please login to merge, or discard this patch.
includes/ContextSource.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;
4 4
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	 * @param MessageProvider $mp
37 37
 	 * @param PageBotList $pbl
38 38
 	 */
39
-	public function __construct(
39
+	public function __construct (
40 40
 		LoggerInterface $logger,
41 41
 		WikiGroup $wikiGroup,
42 42
 		MessageProvider $mp,
@@ -52,14 +52,14 @@  discard block
 block discarded – undo
52 52
 	/**
53 53
 	 * @return LoggerInterface
54 54
 	 */
55
-	protected function getLogger() : LoggerInterface {
55
+	protected function getLogger () : LoggerInterface {
56 56
 		return $this->logger;
57 57
 	}
58 58
 
59 59
 	/**
60 60
 	 * @inheritDoc
61 61
 	 */
62
-	public function setLogger( LoggerInterface $logger ) : void {
62
+	public function setLogger ( LoggerInterface $logger ) : void {
63 63
 		$this->logger = $logger;
64 64
 	}
65 65
 
@@ -69,21 +69,21 @@  discard block
 block discarded – undo
69 69
 	 * @param string $optname
70 70
 	 * @return mixed
71 71
 	 */
72
-	protected function getOpt( string $optname ) {
72
+	protected function getOpt ( string $optname ) {
73 73
 		return $this->getConfig()->get( $optname );
74 74
 	}
75 75
 
76 76
 	/**
77 77
 	 * @return Config
78 78
 	 */
79
-	protected function getConfig() : Config {
79
+	protected function getConfig () : Config {
80 80
 		return $this->config;
81 81
 	}
82 82
 
83 83
 	/**
84 84
 	 * @param Config $cfg
85 85
 	 */
86
-	protected function setConfig( Config $cfg ) : void {
86
+	protected function setConfig ( Config $cfg ) : void {
87 87
 		$this->config = $cfg;
88 88
 	}
89 89
 
@@ -91,35 +91,35 @@  discard block
 block discarded – undo
91 91
 	 * Shorthand
92 92
 	 * @return Wiki
93 93
 	 */
94
-	protected function getWiki() : Wiki {
94
+	protected function getWiki () : Wiki {
95 95
 		return $this->getWikiGroup()->getMainWiki();
96 96
 	}
97 97
 
98 98
 	/**
99 99
 	 * @return WikiGroup
100 100
 	 */
101
-	protected function getWikiGroup() : WikiGroup {
101
+	protected function getWikiGroup () : WikiGroup {
102 102
 		return $this->wikiGroup;
103 103
 	}
104 104
 
105 105
 	/**
106 106
 	 * @param WikiGroup $wikiGroup
107 107
 	 */
108
-	protected function setWikiGroup( WikiGroup $wikiGroup ) : void {
108
+	protected function setWikiGroup ( WikiGroup $wikiGroup ) : void {
109 109
 		$this->wikiGroup = $wikiGroup;
110 110
 	}
111 111
 
112 112
 	/**
113 113
 	 * @return MessageProvider
114 114
 	 */
115
-	protected function getMessageProvider() : MessageProvider {
115
+	protected function getMessageProvider () : MessageProvider {
116 116
 		return $this->messageProvider;
117 117
 	}
118 118
 
119 119
 	/**
120 120
 	 * @param MessageProvider $mp
121 121
 	 */
122
-	protected function setMessageProvider( MessageProvider $mp ) : void {
122
+	protected function setMessageProvider ( MessageProvider $mp ) : void {
123 123
 		$this->messageProvider = $mp;
124 124
 	}
125 125
 
@@ -129,21 +129,21 @@  discard block
 block discarded – undo
129 129
 	 * @param string $key
130 130
 	 * @return Message
131 131
 	 */
132
-	protected function msg( string $key ) : Message {
132
+	protected function msg ( string $key ) : Message {
133 133
 		return $this->messageProvider->getMessage( $key );
134 134
 	}
135 135
 
136 136
 	/**
137 137
 	 * @return PageBotList
138 138
 	 */
139
-	public function getBotList() : PageBotList {
139
+	public function getBotList () : PageBotList {
140 140
 		return $this->pageBotList;
141 141
 	}
142 142
 
143 143
 	/**
144 144
 	 * @return RequestFactory
145 145
 	 */
146
-	public function getRequestFactory() : RequestFactory {
146
+	public function getRequestFactory () : RequestFactory {
147 147
 		return $this->getWiki()->getRequestFactory();
148 148
 	}
149 149
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 	 * @param string $title
154 154
 	 * @return Page
155 155
 	 */
156
-	protected function getPage( string $title ) : Page {
156
+	protected function getPage ( string $title ) : Page {
157 157
 		return new Page( $title, $this->getWiki() );
158 158
 	}
159 159
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	 * @param string $name
164 164
 	 * @return User
165 165
 	 */
166
-	protected function getUser( string $name ) : User {
166
+	protected function getUser ( string $name ) : User {
167 167
 		$ui = $this->getBotList()->getUserInfo( $name );
168 168
 		return new User( $ui, $this->getWiki() );
169 169
 	}
Please login to merge, or discard this patch.
includes/Wiki/UserInfo.php 1 patch
Spacing   +8 added lines, -8 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
 
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	 * @param string $name
18 18
 	 * @param array $info
19 19
 	 */
20
-	public function __construct( string $name, array $info ) {
20
+	public function __construct ( string $name, array $info ) {
21 21
 		$this->name = $name;
22 22
 		$this->info = $info;
23 23
 	}
@@ -25,35 +25,35 @@  discard block
 block discarded – undo
25 25
 	/**
26 26
 	 * @return string
27 27
 	 */
28
-	public function getName() : string {
28
+	public function getName () : string {
29 29
 		return $this->name;
30 30
 	}
31 31
 
32 32
 	/**
33 33
 	 * @return array
34 34
 	 */
35
-	public function getInfo() : array {
35
+	public function getInfo () : array {
36 36
 		return $this->info;
37 37
 	}
38 38
 
39 39
 	/**
40 40
 	 * @return array
41 41
 	 */
42
-	public function extractGroups() : array {
42
+	public function extractGroups () : array {
43 43
 		return array_keys( $this->extractGroupsWithDates() );
44 44
 	}
45 45
 
46 46
 	/**
47 47
 	 * @return array
48 48
 	 */
49
-	public function extractGroupsWithDates() : array {
49
+	public function extractGroupsWithDates () : array {
50 50
 		return array_intersect_key( $this->getInfo(), array_fill_keys( self::GROUP_KEYS, 1 ) );
51 51
 	}
52 52
 
53 53
 	/**
54 54
 	 * @return array
55 55
 	 */
56
-	public function getAliases() : array {
57
-		return $this->getInfo()['aliases'] ?? [];
56
+	public function getAliases () : array {
57
+		return $this->getInfo()[ 'aliases' ] ?? [ ];
58 58
 	}
59 59
 }
Please login to merge, or discard this patch.
includes/Wiki/Page/PageBotList.php 1 patch
Spacing   +25 added lines, -27 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
 
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	 * @param string $listTitle
20 20
 	 * @param Wiki $wiki
21 21
 	 */
22
-	public function __construct( string $listTitle, Wiki $wiki ) {
22
+	public function __construct ( string $listTitle, Wiki $wiki ) {
23 23
 		parent::__construct( $listTitle, $wiki );
24 24
 	}
25 25
 
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 * @param string $listTitle
31 31
 	 * @return self
32 32
 	 */
33
-	public static function get( Wiki $wiki, string $listTitle ) : self {
33
+	public static function get ( Wiki $wiki, string $listTitle ) : self {
34 34
 		static $instance = null;
35 35
 		if ( $instance === null ) {
36 36
 			$instance = new self( $listTitle, $wiki );
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	 * @param UserInfo $ui
43 43
 	 * @return int|null
44 44
 	 */
45
-	public function getOverrideTimestamp( UserInfo $ui ) : ?int {
45
+	public function getOverrideTimestamp ( UserInfo $ui ) : ?int {
46 46
 		$info = $ui->getInfo();
47 47
 		if ( !array_intersect_key( $info, [ 'override-perm' => true, 'override' => true ] ) ) {
48 48
 			return null;
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
 
51 51
 		// A one-time override takes precedence
52 52
 		if ( array_key_exists( 'override', $info ) ) {
53
-			$date = $info['override'];
53
+			$date = $info[ 'override' ];
54 54
 		} else {
55
-			$date = $info['override-prem'] . '/' . date( 'Y' );
55
+			$date = $info[ 'override-prem' ] . '/' . date( 'Y' );
56 56
 		}
57 57
 		return \DateTime::createFromFormat( 'd/m/Y', $date )->getTimestamp();
58 58
 	}
@@ -63,17 +63,17 @@  discard block
 block discarded – undo
63 63
 	 * @param string $user
64 64
 	 * @return int
65 65
 	 */
66
-	public function getNextTimestamp( string $user ) : int {
66
+	public function getNextTimestamp ( string $user ) : int {
67 67
 		$userInfo = $this->getUserInfo( $user )->getInfo();
68
-		if ( isset( $userInfo['override-perm'] ) ) {
68
+		if ( isset( $userInfo[ 'override-perm' ] ) ) {
69 69
 			$date = \DateTime::createFromFormat(
70 70
 				'd/m/Y',
71
-				$userInfo['override-perm'] . '/' . date( 'Y' )
71
+				$userInfo[ 'override-perm' ] . '/' . date( 'Y' )
72 72
 			);
73 73
 		} else {
74 74
 			$date = null;
75
-			if ( isset( $userInfo['override'] ) ) {
76
-				$date = \DateTime::createFromFormat( 'd/m/Y', $userInfo['override'] );
75
+			if ( isset( $userInfo[ 'override' ] ) ) {
76
+				$date = \DateTime::createFromFormat( 'd/m/Y', $userInfo[ 'override' ] );
77 77
 			}
78 78
 			if ( !$date || $date <= new \DateTime ) {
79 79
 				$ts = self::getValidFlagTimestamp( $userInfo );
@@ -92,17 +92,15 @@  discard block
 block discarded – undo
92 92
 	 * @param array $groups
93 93
 	 * @return int
94 94
 	 */
95
-	public static function getValidFlagTimestamp( array $groups ): int {
96
-		$checkuser = isset( $groups['checkuser'] ) ?
97
-			\DateTime::createFromFormat( 'd/m/Y', $groups['checkuser'] )->getTimestamp() :
98
-			0;
99
-		$bureaucrat = isset( $groups['bureaucrat'] ) ?
100
-			\DateTime::createFromFormat( 'd/m/Y', $groups['bureaucrat'] )->getTimestamp() :
101
-			0;
95
+	public static function getValidFlagTimestamp ( array $groups ): int {
96
+		$checkuser = isset( $groups[ 'checkuser' ] ) ?
97
+			\DateTime::createFromFormat( 'd/m/Y', $groups[ 'checkuser' ] )->getTimestamp() : 0;
98
+		$bureaucrat = isset( $groups[ 'bureaucrat' ] ) ?
99
+			\DateTime::createFromFormat( 'd/m/Y', $groups[ 'bureaucrat' ] )->getTimestamp() : 0;
102 100
 
103 101
 		$timestamp = max( $bureaucrat, $checkuser );
104 102
 		if ( $timestamp === 0 ) {
105
-			$timestamp = \DateTime::createFromFormat( 'd/m/Y', $groups['sysop'] )->getTimestamp();
103
+			$timestamp = \DateTime::createFromFormat( 'd/m/Y', $groups[ 'sysop' ] )->getTimestamp();
106 104
 		}
107 105
 		return $timestamp;
108 106
 	}
@@ -111,14 +109,14 @@  discard block
 block discarded – undo
111 109
 	 * @param array $groups
112 110
 	 * @return bool
113 111
 	 */
114
-	public static function isOverrideExpired( array $groups ) : bool {
115
-		if ( !isset( $groups['override'] ) ) {
112
+	public static function isOverrideExpired ( array $groups ) : bool {
113
+		if ( !isset( $groups[ 'override' ] ) ) {
116 114
 			return false;
117 115
 		}
118 116
 
119 117
 		$flagTS = self::getValidFlagTimestamp( $groups );
120 118
 		$usualTS = strtotime( date( 'Y' ) . '-' . date( 'm-d', $flagTS ) );
121
-		$overrideTS = \DateTime::createFromFormat( 'd/m/Y', $groups['override'] )->getTimestamp();
119
+		$overrideTS = \DateTime::createFromFormat( 'd/m/Y', $groups[ 'override' ] )->getTimestamp();
122 120
 		$delay = 60 * 60 * 24 * 3;
123 121
 
124 122
 		return time() > $usualTS + $delay && time() > $overrideTS + $delay;
@@ -129,9 +127,9 @@  discard block
 block discarded – undo
129 127
 	 *
130 128
 	 * @return UserInfo[]
131 129
 	 */
132
-	public function getAdminsList() : array {
130
+	public function getAdminsList () : array {
133 131
 		if ( $this->adminsList === null ) {
134
-			$this->adminsList = [];
132
+			$this->adminsList = [ ];
135 133
 			foreach ( $this->getDecodedContent() as $user => $info ) {
136 134
 				$this->adminsList[ $user ] = new UserInfo( $user, $info );
137 135
 			}
@@ -143,8 +141,8 @@  discard block
 block discarded – undo
143 141
 	 * @param string $user
144 142
 	 * @return UserInfo
145 143
 	 */
146
-	public function getUserInfo( string $user ) : UserInfo {
147
-		return $this->getAdminsList()[$user];
144
+	public function getUserInfo ( string $user ) : UserInfo {
145
+		return $this->getAdminsList()[ $user ];
148 146
 	}
149 147
 
150 148
 	/**
@@ -152,7 +150,7 @@  discard block
 block discarded – undo
152 150
 	 *
153 151
 	 * @return array[]
154 152
 	 */
155
-	public function getDecodedContent() : array {
153
+	public function getDecodedContent () : array {
156 154
 		return json_decode( $this->getContent(), true );
157 155
 	}
158 156
 }
Please login to merge, or discard this patch.
includes/Wiki/User.php 1 patch
Spacing   +13 added lines, -13 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
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	 * @param UserInfo $ui
22 22
 	 * @param Wiki $wiki
23 23
 	 */
24
-	public function __construct( UserInfo $ui, Wiki $wiki ) {
24
+	public function __construct ( UserInfo $ui, Wiki $wiki ) {
25 25
 		$this->wiki = $wiki;
26 26
 		$this->name = $ui->getName();
27 27
 		$this->ui = $ui;
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	/**
31 31
 	 * @return string
32 32
 	 */
33
-	public function getName() : string {
33
+	public function getName () : string {
34 34
 		return $this->name;
35 35
 	}
36 36
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	 *
40 40
 	 * @return string[]
41 41
 	 */
42
-	public function getGroups() : array {
42
+	public function getGroups () : array {
43 43
 		return $this->ui->extractGroups();
44 44
 	}
45 45
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	 *
49 49
 	 * @return string[] [ group => date ]
50 50
 	 */
51
-	public function getGroupsWithDates() : array {
51
+	public function getGroupsWithDates () : array {
52 52
 		return $this->ui->extractGroupsWithDates();
53 53
 	}
54 54
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	 * @param string $groupName
59 59
 	 * @return bool
60 60
 	 */
61
-	public function inGroup( string $groupName ) : bool {
61
+	public function inGroup ( string $groupName ) : bool {
62 62
 		return in_array( $groupName, $this->getGroups(), true );
63 63
 	}
64 64
 
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
 	 *
68 68
 	 * @inheritDoc
69 69
 	 */
70
-	public function getRegex( string $delimiter = '/' ) : string {
70
+	public function getRegex ( string $delimiter = '/' ) : string {
71 71
 		$bits = $this->getAliases();
72
-		$bits[] = $this->name;
72
+		$bits[ ] = $this->name;
73 73
 		$regexify = static function ( $el ) use ( $delimiter ) {
74 74
 			return str_replace( ' ', '[ _]', preg_quote( $el, $delimiter ) );
75 75
 		};
@@ -81,14 +81,14 @@  discard block
 block discarded – undo
81 81
 	 *
82 82
 	 * @return string[]
83 83
 	 */
84
-	public function getAliases() : array {
84
+	public function getAliases () : array {
85 85
 		return $this->ui->getAliases();
86 86
 	}
87 87
 
88 88
 	/**
89 89
 	 * @return Page
90 90
 	 */
91
-	public function getTalkPage() : Page {
91
+	public function getTalkPage () : Page {
92 92
 		return new Page( "User talk:{$this->name}", $this->wiki );
93 93
 	}
94 94
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 * Get the default base page, e.g. WP:A/Riconferma annuale/XXX
97 97
 	 * @return Page
98 98
 	 */
99
-	public function getBasePage() : Page {
99
+	public function getBasePage () : Page {
100 100
 		$prefix = Config::getInstance()->get( 'main-page-title' );
101 101
 		return new Page( "$prefix/$this", $this->wiki );
102 102
 	}
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	 * @throws MissingPageException
109 109
 	 * @return Page
110 110
 	 */
111
-	public function getExistingBasePage() : Page {
111
+	public function getExistingBasePage () : Page {
112 112
 		$basePage = $this->getBasePage();
113 113
 		if ( !$basePage->exists() ) {
114 114
 			$basePage = null;
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 	/**
133 133
 	 * @return string
134 134
 	 */
135
-	public function __toString() {
135
+	public function __toString () {
136 136
 		return $this->name;
137 137
 	}
138 138
 }
Please login to merge, or discard this patch.
includes/Utils/IRegexAble.php 1 patch
Spacing   +2 added lines, -2 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\Utils;
4 4
 
@@ -9,5 +9,5 @@  discard block
 block discarded – undo
9 9
 	 * @param string $delimiter
10 10
 	 * @return string
11 11
 	 */
12
-	public function getRegex( string $delimiter ) : string;
12
+	public function getRegex ( string $delimiter ) : string;
13 13
 }
Please login to merge, or discard this patch.
includes/Utils/RegexUtils.php 1 patch
Spacing   +4 added lines, -4 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\Utils;
4 4
 
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
 	 * @param IRegexAble ...$elements
11 11
 	 * @return string
12 12
 	 */
13
-	public static function regexFromArray(
13
+	public static function regexFromArray (
14 14
 		string $delimiter = '/',
15 15
 		IRegexAble ...$elements
16 16
 	) : string {
17
-		$bits = [];
17
+		$bits = [ ];
18 18
 		foreach ( $elements as $el ) {
19
-			$bits[] = $el->getRegex( $delimiter );
19
+			$bits[ ] = $el->getRegex( $delimiter );
20 20
 		}
21 21
 		return '(?:' . implode( '|', $bits ) . ')';
22 22
 	}
Please login to merge, or discard this patch.
includes/Task/Subtask/SimpleUpdates.php 1 patch
Spacing   +18 added lines, -18 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 ) {
@@ -36,15 +36,15 @@  discard block
 block discarded – undo
36 36
 	 * @param PageRiconferma[] $pages
37 37
 	 * @see OpenUpdates::addToVotazioni()
38 38
 	 */
39
-	protected function updateVotazioni( array $pages ) : void {
39
+	protected function updateVotazioni ( array $pages ) : void {
40 40
 		$this->getLogger()->info(
41 41
 			'Updating votazioni: ' . implode( ', ', $pages )
42 42
 		);
43 43
 		$votePage = $this->getPage( $this->getOpt( 'vote-page-title' ) );
44 44
 
45
-		$users = [];
45
+		$users = [ ];
46 46
 		foreach ( $pages as $page ) {
47
-			$users[] = $this->getUser( $page->getUserName() );
47
+			$users[ ] = $this->getUser( $page->getUserName() );
48 48
 		}
49 49
 		$usersReg = RegexUtils::regexFromArray( '!', ...$users );
50 50
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	 * @param array $pages
66 66
 	 * @see OpenUpdates::addToNews()
67 67
 	 */
68
-	protected function updateNews( array $pages ) : void {
68
+	protected function updateNews ( array $pages ) : void {
69 69
 		$simpleAmount = $voteAmount = 0;
70 70
 		foreach ( $pages as $page ) {
71 71
 			if ( $page->isVote() ) {
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
 		$simpleMatches = $newsPage->getMatch( $simpleReg );
86 86
 		$voteMatches = $newsPage->getMatch( $voteReg );
87 87
 
88
-		$newSimp = ( (int)$simpleMatches[2] - $simpleAmount ) ?: '';
89
-		$newVote = ( (int)$voteMatches[2] - $voteAmount ) ?: '';
88
+		$newSimp = ( (int)$simpleMatches[ 2 ] - $simpleAmount ) ?: '';
89
+		$newVote = ( (int)$voteMatches[ 2 ] - $voteAmount ) ?: '';
90 90
 		$newContent = preg_replace( $simpleReg, '${1}' . $newSimp, $newsPage->getContent() );
91 91
 		$newContent = preg_replace( $voteReg, '${1}' . $newVote, $newContent );
92 92
 
@@ -104,12 +104,12 @@  discard block
 block discarded – undo
104 104
 	 *
105 105
 	 * @param bool[] $outcomes
106 106
 	 */
107
-	protected function updateAdminList( array $outcomes ) : void {
107
+	protected function updateAdminList ( array $outcomes ) : void {
108 108
 		$this->getLogger()->info( 'Updating admin list' );
109 109
 		$adminsPage = $this->getPage( $this->getOpt( 'admins-list-title' ) );
110 110
 		$newContent = $adminsPage->getContent();
111 111
 
112
-		$riconfNames = $removeNames = [];
112
+		$riconfNames = $removeNames = [ ];
113 113
 		foreach ( $outcomes as $username => $confirmed ) {
114 114
 			$user = $this->getUser( $username );
115 115
 			$userReg = $user->getRegex( '!' );
@@ -124,10 +124,10 @@  discard block
 block discarded – undo
124 124
 					'${1}{{subst:#timel:Ymd}}|' . $nextDate . '$2',
125 125
 					$newContent
126 126
 				);
127
-				$riconfNames[] = $username;
127
+				$riconfNames[ ] = $username;
128 128
 			} else {
129 129
 				$newContent = preg_replace( $reg, '', $newContent );
130
-				$removeNames[] = $username;
130
+				$removeNames[ ] = $username;
131 131
 			}
132 132
 		}
133 133
 
@@ -147,21 +147,21 @@  discard block
 block discarded – undo
147 147
 	/**
148 148
 	 * @param bool[] $outcomes
149 149
 	 */
150
-	protected function updateCUList( array $outcomes ) : void {
150
+	protected function updateCUList ( array $outcomes ) : void {
151 151
 		$this->getLogger()->info( 'Updating CU list.' );
152 152
 		$cuList = $this->getPage( $this->getOpt( 'cu-list-title' ) );
153 153
 		$newContent = $cuList->getContent();
154 154
 
155
-		$riconfNames = $removeNames = [];
155
+		$riconfNames = $removeNames = [ ];
156 156
 		foreach ( $outcomes as $user => $confirmed ) {
157 157
 			$userReg = $this->getUser( $user )->getRegex( '!' );
158 158
 			$reg = "!(\{\{ *Checkuser *\| *$userReg *\|[^}]+\| *)[\w \d]+(}}.*\n)!";
159 159
 			if ( $confirmed ) {
160 160
 				$newContent = preg_replace( $reg, '${1}{{subst:#time:j F Y}}$2', $newContent );
161
-				$riconfNames[] = $user;
161
+				$riconfNames[ ] = $user;
162 162
 			} else {
163 163
 				$newContent = preg_replace( $reg, '', $newContent );
164
-				$removeNames[] = $user;
164
+				$removeNames[ ] = $user;
165 165
 			}
166 166
 		}
167 167
 
@@ -185,8 +185,8 @@  discard block
 block discarded – undo
185 185
 	 * @param PageRiconferma[] $pages
186 186
 	 * @return bool[]
187 187
 	 */
188
-	private function getGroupOutcomes( string $group, array $pages ) : array {
189
-		$ret = [];
188
+	private function getGroupOutcomes ( string $group, array $pages ) : array {
189
+		$ret = [ ];
190 190
 		foreach ( $pages as $page ) {
191 191
 			$user = $this->getUser( $page->getUserName() );
192 192
 			if ( $user->inGroup( $group ) ) {
Please login to merge, or discard this patch.
includes/Task/Task.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\Task;
4 4
 
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
 	 *
15 15
 	 * @return string[]
16 16
 	 */
17
-	abstract protected function getSubtasksMap() : array;
17
+	abstract protected function getSubtasksMap () : array;
18 18
 
19 19
 	/**
20 20
 	 * @param string $subtask Defined in self::SUBTASKS_MAP
21 21
 	 * @return \BotRiconferme\TaskHelper\TaskResult
22 22
 	 */
23
-	protected function runSubtask( string $subtask ) : TaskResult {
23
+	protected function runSubtask ( string $subtask ) : TaskResult {
24 24
 		$map = $this->getSubtasksMap();
25 25
 		if ( !isset( $map[ $subtask ] ) ) {
26 26
 			throw new \InvalidArgumentException( "'$subtask' is not a valid task." );
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	/**
34 34
 	 * @inheritDoc
35 35
 	 */
36
-	final public function getOperationName(): string {
36
+	final public function getOperationName (): string {
37 37
 		return 'task';
38 38
 	}
39 39
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 * @param string $class
44 44
 	 * @return Subtask
45 45
 	 */
46
-	private function getSubtaskInstance( string $class ) : Subtask {
46
+	private function getSubtaskInstance ( string $class ) : Subtask {
47 47
 		/** @var Subtask $ret */
48 48
 		$ret = new $class(
49 49
 			$this->getLogger(),
Please login to merge, or discard this patch.