@@ -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 | $bureaucrats = $this->getFailedBureaucrats( $failed ); |
@@ -36,12 +36,12 @@ discard block |
||
| 36 | 36 | * |
| 37 | 37 | * @return PageRiconferma[] |
| 38 | 38 | */ |
| 39 | - private function getFailures() : array { |
|
| 40 | - $ret = []; |
|
| 39 | + private function getFailures () : array { |
|
| 40 | + $ret = [ ]; |
|
| 41 | 41 | $allPages = $this->getDataProvider()->getPagesToClose(); |
| 42 | 42 | foreach ( $allPages as $page ) { |
| 43 | 43 | if ( $page->getOutcome() & PageRiconferma::OUTCOME_FAIL ) { |
| 44 | - $ret[] = $page; |
|
| 44 | + $ret[ ] = $page; |
|
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | return $ret; |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | /** |
| 51 | 51 | * @param User[] $users |
| 52 | 52 | */ |
| 53 | - protected function updateBurList( array $users ) { |
|
| 53 | + protected function updateBurList ( array $users ) { |
|
| 54 | 54 | $this->getLogger()->info( 'Updating bur list. Removing: ' . implode( ', ', $users ) ); |
| 55 | 55 | $remList = Element::regexFromArray( $users ); |
| 56 | 56 | $burList = new Page( $this->getConfig()->get( 'bur-list-title' ) ); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | * |
| 74 | 74 | * @param PageRiconferma[] $pages |
| 75 | 75 | */ |
| 76 | - protected function requestRemoval( array $pages ) { |
|
| 76 | + protected function requestRemoval ( array $pages ) { |
|
| 77 | 77 | $this->getLogger()->info( 'Requesting flag removal for: ' . implode( ', ', $pages ) ); |
| 78 | 78 | |
| 79 | 79 | $flagRemPage = new Page( |
@@ -109,16 +109,16 @@ discard block |
||
| 109 | 109 | * |
| 110 | 110 | * @param PageRiconferma[] $pages |
| 111 | 111 | */ |
| 112 | - protected function updateAnnunci( array $pages ) { |
|
| 112 | + protected function updateAnnunci ( array $pages ) { |
|
| 113 | 113 | $this->getLogger()->info( 'Updating annunci' ); |
| 114 | 114 | $section = 1; |
| 115 | 115 | |
| 116 | - $names = []; |
|
| 116 | + $names = [ ]; |
|
| 117 | 117 | $text = ''; |
| 118 | 118 | $msg = $this->msg( 'annunci-text' ); |
| 119 | 119 | foreach ( $pages as $page ) { |
| 120 | 120 | $user = $page->getUser()->getName(); |
| 121 | - $names[] = $user; |
|
| 121 | + $names[ ] = $user; |
|
| 122 | 122 | $text .= $msg->params( [ '$user' => $user ] )->text(); |
| 123 | 123 | } |
| 124 | 124 | |
@@ -150,16 +150,16 @@ discard block |
||
| 150 | 150 | * |
| 151 | 151 | * @param PageRiconferma[] $pages |
| 152 | 152 | */ |
| 153 | - protected function updateUltimeNotizie( array $pages ) { |
|
| 153 | + protected function updateUltimeNotizie ( array $pages ) { |
|
| 154 | 154 | $this->getLogger()->info( 'Updating ultime notizie' ); |
| 155 | 155 | $notiziePage = new Page( $this->getConfig()->get( 'ultimenotizie-page-title' ) ); |
| 156 | 156 | |
| 157 | - $names = []; |
|
| 157 | + $names = [ ]; |
|
| 158 | 158 | $text = ''; |
| 159 | 159 | $msg = $this->msg( 'ultimenotizie-text' ); |
| 160 | 160 | foreach ( $pages as $page ) { |
| 161 | 161 | $user = $page->getUser()->getName(); |
| 162 | - $names[] = $user; |
|
| 162 | + $names[ ] = $user; |
|
| 163 | 163 | $text .= $msg->params( [ '$user' => $user, '$title' => $page->getTitle() ] )->text(); |
| 164 | 164 | } |
| 165 | 165 | |
@@ -188,12 +188,12 @@ discard block |
||
| 188 | 188 | * @param PageRiconferma[] $pages |
| 189 | 189 | * @return User[] |
| 190 | 190 | */ |
| 191 | - private function getFailedBureaucrats( array $pages ) : array { |
|
| 192 | - $ret = []; |
|
| 191 | + private function getFailedBureaucrats ( array $pages ) : array { |
|
| 192 | + $ret = [ ]; |
|
| 193 | 193 | foreach ( $pages as $page ) { |
| 194 | 194 | $user = $page->getUser(); |
| 195 | 195 | if ( $user->inGroup( 'bureaucrat' ) ) { |
| 196 | - $ret[] = $user; |
|
| 196 | + $ret[ ] = $user; |
|
| 197 | 197 | } |
| 198 | 198 | } |
| 199 | 199 | 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\Wiki; |
| 4 | 4 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * |
| 12 | 12 | * @return string |
| 13 | 13 | */ |
| 14 | - abstract public function getRegex() : string; |
|
| 14 | + abstract public function getRegex () : string; |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Get a regex matching any element in the given array |
@@ -20,10 +20,10 @@ discard block |
||
| 20 | 20 | * @return string |
| 21 | 21 | * @todo Is this the right place? |
| 22 | 22 | */ |
| 23 | - public static function regexFromArray( array $elements ) : string { |
|
| 24 | - $bits = []; |
|
| 23 | + public static function regexFromArray ( array $elements ) : string { |
|
| 24 | + $bits = [ ]; |
|
| 25 | 25 | foreach ( $elements as $el ) { |
| 26 | - $bits[] = $el->getRegex(); |
|
| 26 | + $bits[ ] = $el->getRegex(); |
|
| 27 | 27 | } |
| 28 | 28 | return '(?:' . implode( '|', $bits ) . ')'; |
| 29 | 29 | } |