@@ -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; |
| 4 | 4 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | /** @var string[] */ |
| 20 | 20 | private $tokens; |
| 21 | 21 | |
| 22 | - public function __construct() { |
|
| 22 | + public function __construct () { |
|
| 23 | 23 | $this->logger = new Logger; |
| 24 | 24 | } |
| 25 | 25 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * @return string |
| 31 | 31 | * @throws MissingPageException |
| 32 | 32 | */ |
| 33 | - public function getPageContent( string $title ) : string { |
|
| 33 | + public function getPageContent ( string $title ) : string { |
|
| 34 | 34 | $this->logger->debug( "Retrieving page $title" ); |
| 35 | 35 | $params = [ |
| 36 | 36 | 'action' => 'query', |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | throw new MissingPageException( $title ); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - return $page->revisions[0]->slots->main->{ '*' }; |
|
| 51 | + return $page->revisions[ 0 ]->slots->main->{ '*' }; |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * @param array $params |
| 58 | 58 | * @throws EditException |
| 59 | 59 | */ |
| 60 | - public function editPage( array $params ) { |
|
| 60 | + public function editPage ( array $params ) { |
|
| 61 | 61 | $this->login(); |
| 62 | 62 | |
| 63 | 63 | $params = [ |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | * Login wrapper. Checks if we're already logged in and clears tokens cache |
| 77 | 77 | * @throws LoginException |
| 78 | 78 | */ |
| 79 | - public function login() { |
|
| 79 | + public function login () { |
|
| 80 | 80 | if ( self::$loggedIn ) { |
| 81 | 81 | $this->logger->debug( 'Already logged in' ); |
| 82 | 82 | return; |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | self::$loggedIn = true; |
| 105 | 105 | // Clear tokens cache |
| 106 | - $this->tokens = []; |
|
| 106 | + $this->tokens = [ ]; |
|
| 107 | 107 | $this->logger->info( 'Login succeeded' ); |
| 108 | 108 | } |
| 109 | 109 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | * @param string $type |
| 114 | 114 | * @return string |
| 115 | 115 | */ |
| 116 | - public function getToken( string $type ) : string { |
|
| 116 | + public function getToken ( string $type ) : string { |
|
| 117 | 117 | if ( !isset( $this->tokens[ $type ] ) ) { |
| 118 | 118 | $params = [ |
| 119 | 119 | 'action' => 'query', |