Passed
Push — master ( db90a8...2e33cb )
by Daimona
13:14 queued 11:27
created
includes/Exception/PermissionDeniedException.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/StartNew.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\Task;
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
 		$orderedList = [
19 19
 			'create-pages',
20 20
 			'open-updates',
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
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,
Please login to merge, or discard this patch.
includes/Request/CurlRequest.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\Request;
4 4
 
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 	 * @inheritDoc
13 13
 	 * @throws APIRequestException
14 14
 	 */
15
-	protected function reallyMakeRequest( string $params ) : string {
15
+	protected function reallyMakeRequest ( string $params ) : string {
16 16
 		$curl = curl_init();
17 17
 		if ( $curl === false ) {
18 18
 			throw new APIRequestException( 'Cannot open cURL handler.' );
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
 	 * @internal Only used as CB for cURL (CURLOPT_HEADERFUNCTION)
56 56
 	 * @suppress PhanUnreferencedPublicMethod,PhanUnusedPublicNoOverrideMethodParameter
57 57
 	 */
58
-	public function headersHandler( $ch, string $header ) : int {
58
+	public function headersHandler ( $ch, string $header ) : int {
59 59
 		$bits = explode( ':', $header, 2 );
60
-		if ( trim( $bits[0] ) === 'Set-Cookie' ) {
61
-			$this->newCookies[] = $bits[1];
60
+		if ( trim( $bits[ 0 ] ) === 'Set-Cookie' ) {
61
+			$this->newCookies[ ] = $bits[ 1 ];
62 62
 		}
63 63
 
64 64
 		return strlen( $header );
Please login to merge, or discard this patch.
includes/Logger/IFlushingAwareLogger.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\Logger;
4 4
 
@@ -8,5 +8,5 @@  discard block
 block discarded – undo
8 8
  * Logger aware of flushing. Can be declared empty if the buffer is flushed immediately.
9 9
  */
10 10
 interface IFlushingAwareLogger extends LoggerInterface {
11
-	public function flush() : void;
11
+	public function flush () : void;
12 12
 }
Please login to merge, or discard this patch.
includes/Task/Subtask/OpenUpdates.php 1 patch
Spacing   +6 added lines, -6 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
 
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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' )
Please login to merge, or discard this patch.
includes/Task/Subtask/ArchivePages.php 1 patch
Spacing   +14 added lines, -14 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
 
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
includes/Logger/LoggerTrait.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\Logger;
4 4
 
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
includes/Exception/MissingMatchException.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/Request/NativeRequest.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\Request;
4 4
 
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 	/**
10 10
 	 * @inheritDoc
11 11
 	 */
12
-	protected function reallyMakeRequest( string $params ) : string {
12
+	protected function reallyMakeRequest ( string $params ) : string {
13 13
 		$context = [
14 14
 			'http' => [
15 15
 				'method' => $this->method,
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 		];
19 19
 		$url = $this->url;
20 20
 		if ( $this->method === self::METHOD_POST ) {
21
-			$context['http']['content'] = $params;
21
+			$context[ 'http' ][ 'content' ] = $params;
22 22
 		} else {
23 23
 			$url = "$url?$params";
24 24
 		}
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
 
28 28
 		foreach ( $http_response_header as $header ) {
29 29
 			$bits = explode( ':', $header, 2 );
30
-			if ( trim( $bits[0] ) === 'Set-Cookie' ) {
31
-				$this->newCookies[] = $bits[1];
30
+			if ( trim( $bits[ 0 ] ) === 'Set-Cookie' ) {
31
+				$this->newCookies[ ] = $bits[ 1 ];
32 32
 			}
33 33
 		}
34 34
 
Please login to merge, or discard this patch.