@@ -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; |
4 | 4 | |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | /** |
15 | 15 | * @inheritDoc |
16 | 16 | */ |
17 | - public function runInternal() : int { |
|
17 | + public function runInternal () : int { |
|
18 | 18 | $orderedList = [ |
19 | 19 | 'create-pages', |
20 | 20 | 'open-updates', |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | /** |
33 | 33 | * @inheritDoc |
34 | 34 | */ |
35 | - protected function getSubtasksMap() : array { |
|
35 | + protected function getSubtasksMap () : array { |
|
36 | 36 | return [ |
37 | 37 | 'create-pages' => CreatePages::class, |
38 | 38 | 'open-updates' => OpenUpdates::class, |
@@ -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()->getCreatedPages(); |
18 | 18 | |
19 | 19 | if ( !$pages ) { |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * |
36 | 36 | * @param PageRiconferma[] $pages |
37 | 37 | */ |
38 | - protected function addToMainPage( array $pages ) : void { |
|
38 | + protected function addToMainPage ( array $pages ) : void { |
|
39 | 39 | $this->getLogger()->info( |
40 | 40 | 'Adding the following to main: ' . implode( ', ', $pages ) |
41 | 41 | ); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @param PageRiconferma[] $pages |
70 | 70 | */ |
71 | - protected function addToVotazioni( array $pages ) : void { |
|
71 | + protected function addToVotazioni ( array $pages ) : void { |
|
72 | 72 | $this->getLogger()->info( |
73 | 73 | 'Adding the following to votes: ' . implode( ', ', $pages ) |
74 | 74 | ); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * @param int $amount |
106 | 106 | * @throws TaskException |
107 | 107 | */ |
108 | - protected function addToNews( int $amount ) : void { |
|
108 | + protected function addToNews ( int $amount ) : void { |
|
109 | 109 | $this->getLogger()->info( "Increasing the news counter by $amount" ); |
110 | 110 | $newsPage = $this->getPage( $this->getOpt( 'news-page-title' ) ); |
111 | 111 | |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | $matches = $newsPage->getMatch( $reg ); |
120 | 120 | |
121 | - $newNum = (int)$matches[2] + $amount; |
|
121 | + $newNum = (int)$matches[ 2 ] + $amount; |
|
122 | 122 | $newContent = preg_replace( $reg, '${1}' . $newNum, $content ); |
123 | 123 | |
124 | 124 | $summary = $this->msg( 'news-page-summary' ) |
@@ -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 |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare( strict_types=1 ); |
|
1 | +<?php declare(strict_types=1); |
|
2 | 2 | |
3 | 3 | namespace BotRiconferme\Logger; |
4 | 4 | |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * @param string $level |
12 | 12 | * @return int |
13 | 13 | */ |
14 | - protected function levelToInt( string $level ) : int { |
|
14 | + protected function levelToInt ( string $level ) : int { |
|
15 | 15 | // Order matters |
16 | 16 | $mapping = [ |
17 | 17 | LogLevel::DEBUG, |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @param string $message |
32 | 32 | * @return string |
33 | 33 | */ |
34 | - protected function getFormattedMessage( string $level, string $message ) : string { |
|
34 | + protected function getFormattedMessage ( string $level, string $message ) : string { |
|
35 | 35 | return sprintf( '%s [%s] - %s', date( 'd M H:i:s' ), $level, $message ); |
36 | 36 | } |
37 | 37 | } |
@@ -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 |