@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare( strict_types=1 ); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace BotRiconferme\Exception; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare( strict_types=1 ); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace BotRiconferme\Exception; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare( strict_types=1 ); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace BotRiconferme\Exception; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare( strict_types=1 ); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace BotRiconferme\Exception; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare( strict_types=1 ); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace BotRiconferme\Exception; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare( strict_types=1 ); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace BotRiconferme\Exception; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare( strict_types=1 ); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace BotRiconferme\Task\Subtask; |
| 4 | 4 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | /** |
| 12 | 12 | * @inheritDoc |
| 13 | 13 | */ |
| 14 | - final public function getOperationName(): string { |
|
| 14 | + final public function getOperationName (): string { |
|
| 15 | 15 | return 'subtask'; |
| 16 | 16 | } |
| 17 | 17 | } |
@@ -1,4 +1,4 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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,21 +115,21 @@ discard block |
||
| 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 | |
| 130 | 130 | /** @var string $curMonth */ |
| 131 | 131 | $curMonth = date( 'F' ); |
| 132 | - $month = ucfirst( Message::MONTHS[$curMonth] ); |
|
| 132 | + $month = ucfirst( Message::MONTHS[ $curMonth ] ); |
|
| 133 | 133 | |
| 134 | 134 | $annunciPage = $this->getPage( $this->getOpt( 'annunci-page-title' ) ); |
| 135 | 135 | $content = $annunciPage->getContent( $section ); |
@@ -157,16 +157,16 @@ discard block |
||
| 157 | 157 | * |
| 158 | 158 | * @param PageRiconferma[] $pages |
| 159 | 159 | */ |
| 160 | - protected function updateUltimeNotizie( array $pages ): void { |
|
| 160 | + protected function updateUltimeNotizie ( array $pages ): void { |
|
| 161 | 161 | $this->getLogger()->info( 'Updating ultime notizie' ); |
| 162 | 162 | $notiziePage = $this->getPage( $this->getOpt( 'ultimenotizie-page-title' ) ); |
| 163 | 163 | |
| 164 | - $names = []; |
|
| 164 | + $names = [ ]; |
|
| 165 | 165 | $text = ''; |
| 166 | 166 | $msg = $this->msg( 'ultimenotizie-text' ); |
| 167 | 167 | foreach ( $pages as $page ) { |
| 168 | 168 | $user = $page->getUserName(); |
| 169 | - $names[] = $user; |
|
| 169 | + $names[ ] = $user; |
|
| 170 | 170 | $text .= $msg->params( [ '$user' => $user, '$title' => $page->getTitle() ] )->text(); |
| 171 | 171 | } |
| 172 | 172 | |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | * |
| 195 | 195 | * @param PageRiconferma[] $pages |
| 196 | 196 | */ |
| 197 | - protected function updateTimeline( array $pages ): void { |
|
| 197 | + protected function updateTimeline ( array $pages ): void { |
|
| 198 | 198 | $this->getLogger()->info( 'Updating timeline' ); |
| 199 | 199 | $timelinePage = $this->getPage( $this->getOpt( 'timeline-page-title' ) ); |
| 200 | 200 | $content = $timelinePage->getContent(); |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | * |
| 223 | 223 | * @param PageRiconferma[] $pages |
| 224 | 224 | */ |
| 225 | - private function updateCronologia( array $pages ): void { |
|
| 225 | + private function updateCronologia ( array $pages ): void { |
|
| 226 | 226 | $this->getLogger()->info( 'Updating cronologia' ); |
| 227 | 227 | $timelinePage = $this->getPage( $this->getOpt( 'cronologia-page-title' ) ); |
| 228 | 228 | $content = $timelinePage->getContent(); |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | * |
| 250 | 250 | * @param PageRiconferma[] $pages |
| 251 | 251 | */ |
| 252 | - private function blockOnPrivate( array $pages ): void { |
|
| 252 | + private function blockOnPrivate ( array $pages ): void { |
|
| 253 | 253 | $this->getLogger()->info( 'Blocking on private wiki: ' . implode( ', ', $pages ) ); |
| 254 | 254 | |
| 255 | 255 | $privWiki = $this->getWikiGroup()->getPrivateWiki(); |
@@ -266,12 +266,12 @@ discard block |
||
| 266 | 266 | * @param PageRiconferma[] $pages |
| 267 | 267 | * @return User[] |
| 268 | 268 | */ |
| 269 | - private function getFailedBureaucrats( array $pages ): array { |
|
| 270 | - $ret = []; |
|
| 269 | + private function getFailedBureaucrats ( array $pages ): array { |
|
| 270 | + $ret = [ ]; |
|
| 271 | 271 | foreach ( $pages as $page ) { |
| 272 | 272 | $user = $this->getUser( $page->getUserName() ); |
| 273 | 273 | if ( $user->inGroup( 'bureaucrat' ) ) { |
| 274 | - $ret[] = $user; |
|
| 274 | + $ret[ ] = $user; |
|
| 275 | 275 | } |
| 276 | 276 | } |
| 277 | 277 | return $ret; |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare( strict_types=1 ); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace BotRiconferme\Task\Subtask; |
| 4 | 4 | |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | /** |
| 14 | 14 | * @inheritDoc |
| 15 | 15 | */ |
| 16 | - public function runInternal(): int { |
|
| 16 | + public function runInternal (): int { |
|
| 17 | 17 | $pages = $this->getDataProvider()->getPagesToClose(); |
| 18 | 18 | |
| 19 | 19 | if ( !$pages ) { |
@@ -32,18 +32,18 @@ discard block |
||
| 32 | 32 | * @param PageRiconferma[] $pages |
| 33 | 33 | * @see OpenUpdates::addToMainPage() |
| 34 | 34 | */ |
| 35 | - protected function removeFromMainPage( array $pages ): void { |
|
| 35 | + protected function removeFromMainPage ( array $pages ): void { |
|
| 36 | 36 | $this->getLogger()->info( |
| 37 | 37 | 'Removing from main: ' . implode( ', ', $pages ) |
| 38 | 38 | ); |
| 39 | 39 | |
| 40 | 40 | $mainPage = $this->getPage( $this->getOpt( 'main-page-title' ) ); |
| 41 | - $remove = []; |
|
| 41 | + $remove = [ ]; |
|
| 42 | 42 | foreach ( $pages as $page ) { |
| 43 | 43 | // Order matters here. It's not guaranteed that there'll be a newline, but avoid |
| 44 | 44 | // regexps for that single character. |
| 45 | - $remove[] = '{{' . $page->getTitle() . "}}\n"; |
|
| 46 | - $remove[] = '{{' . $page->getTitle() . '}}'; |
|
| 45 | + $remove[ ] = '{{' . $page->getTitle() . "}}\n"; |
|
| 46 | + $remove[ ] = '{{' . $page->getTitle() . '}}'; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | $newContent = str_replace( $remove, '', $mainPage->getContent() ); |
@@ -72,17 +72,17 @@ discard block |
||
| 72 | 72 | * |
| 73 | 73 | * @param PageRiconferma[] $pages |
| 74 | 74 | */ |
| 75 | - protected function addToArchive( array $pages ): void { |
|
| 75 | + protected function addToArchive ( array $pages ): void { |
|
| 76 | 76 | $this->getLogger()->info( |
| 77 | 77 | 'Adding to archive: ' . implode( ', ', $pages ) |
| 78 | 78 | ); |
| 79 | 79 | |
| 80 | - $simple = $votes = []; |
|
| 80 | + $simple = $votes = [ ]; |
|
| 81 | 81 | foreach ( $pages as $page ) { |
| 82 | 82 | if ( $page->isVote() ) { |
| 83 | - $votes[] = $page; |
|
| 83 | + $votes[ ] = $page; |
|
| 84 | 84 | } else { |
| 85 | - $simple[] = $page; |
|
| 85 | + $simple[ ] = $page; |
|
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | |
@@ -103,15 +103,15 @@ discard block |
||
| 103 | 103 | * @param string $archiveTitle |
| 104 | 104 | * @param PageRiconferma[] $pages |
| 105 | 105 | */ |
| 106 | - private function reallyAddToArchive( string $archiveTitle, array $pages ): void { |
|
| 106 | + private function reallyAddToArchive ( string $archiveTitle, array $pages ): void { |
|
| 107 | 107 | $archivePage = $this->getPage( "$archiveTitle/" . date( 'Y' ) ); |
| 108 | 108 | $existed = $archivePage->exists(); |
| 109 | 109 | |
| 110 | 110 | $append = "\n"; |
| 111 | - $archivedList = []; |
|
| 111 | + $archivedList = [ ]; |
|
| 112 | 112 | foreach ( $pages as $page ) { |
| 113 | 113 | $append .= '{{' . $page->getTitle() . "}}\n"; |
| 114 | - $archivedList[] = $page->getUserNum(); |
|
| 114 | + $archivedList[ ] = $page->getUserNum(); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | $summary = $this->msg( 'close-archive-summary' ) |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | * |
| 133 | 133 | * @param string $archiveTitle |
| 134 | 134 | */ |
| 135 | - private function addArchiveYear( string $archiveTitle ): void { |
|
| 135 | + private function addArchiveYear ( string $archiveTitle ): void { |
|
| 136 | 136 | $page = $this->getPage( $archiveTitle ); |
| 137 | 137 | $year = date( 'Y' ); |
| 138 | 138 | |