@@ -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; |
| 4 | 4 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | /** |
| 12 | 12 | * @inheritDoc |
| 13 | 13 | */ |
| 14 | - public function log( $level, $message, array $context = [] ) { |
|
| 14 | + public function log ( $level, $message, array $context = [ ] ) { |
|
| 15 | 15 | error_log( "$level - $message" ); |
| 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\Exception; |
| 4 | 4 | |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | /** |
| 10 | 10 | * @param string|null $title If available |
| 11 | 11 | */ |
| 12 | - public function __construct( string $title = null ) { |
|
| 12 | + public function __construct ( string $title = null ) { |
|
| 13 | 13 | if ( $title ) { |
| 14 | 14 | parent::__construct( "The specified page is protected: $title" ); |
| 15 | 15 | } else { |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare( strict_types=1 ); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace BotRiconferme\Exception; |
| 4 | 4 | |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | /** |
| 10 | 10 | * @param string|null $title If available |
| 11 | 11 | */ |
| 12 | - public function __construct( string $title = null ) { |
|
| 12 | + public function __construct ( string $title = null ) { |
|
| 13 | 13 | if ( $title ) { |
| 14 | 14 | parent::__construct( "The specified page doesn't exist: $title" ); |
| 15 | 15 | } else { |
@@ -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 | |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | * @param int $status One of the Task::STATUS_* constants |
| 21 | 21 | * @param string[] $errors |
| 22 | 22 | */ |
| 23 | - public function __construct( int $status, array $errors = [] ) { |
|
| 23 | + public function __construct ( int $status, array $errors = [ ] ) { |
|
| 24 | 24 | $this->status = $status; |
| 25 | 25 | $this->errors = $errors; |
| 26 | 26 | } |
@@ -28,21 +28,21 @@ discard block |
||
| 28 | 28 | /** |
| 29 | 29 | * @return int |
| 30 | 30 | */ |
| 31 | - public function getStatus() : int { |
|
| 31 | + public function getStatus () : int { |
|
| 32 | 32 | return $this->status; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * @return string[] |
| 37 | 37 | */ |
| 38 | - public function getErrors() { |
|
| 38 | + public function getErrors () { |
|
| 39 | 39 | return $this->errors; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * @param TaskResult $that |
| 44 | 44 | */ |
| 45 | - public function merge( TaskResult $that ) { |
|
| 45 | + public function merge ( TaskResult $that ) { |
|
| 46 | 46 | $this->status |= $that->status; |
| 47 | 47 | $this->errors = array_merge( $this->errors, $that->errors ); |
| 48 | 48 | } |
@@ -50,15 +50,15 @@ discard block |
||
| 50 | 50 | /** |
| 51 | 51 | * @return string |
| 52 | 52 | */ |
| 53 | - public function __toString() { |
|
| 53 | + public function __toString () { |
|
| 54 | 54 | if ( $this->isOK() ) { |
| 55 | 55 | $stat = 'OK'; |
| 56 | 56 | $errs = "\tNo errors."; |
| 57 | 57 | } else { |
| 58 | 58 | $stat = 'ERROR'; |
| 59 | - $formattedErrs = []; |
|
| 59 | + $formattedErrs = [ ]; |
|
| 60 | 60 | foreach ( $this->errors as $err ) { |
| 61 | - $formattedErrs[] = "\t - $err"; |
|
| 61 | + $formattedErrs[ ] = "\t - $err"; |
|
| 62 | 62 | } |
| 63 | 63 | $errs = implode( "\n", $formattedErrs ); |
| 64 | 64 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * |
| 71 | 71 | * @return bool |
| 72 | 72 | */ |
| 73 | - public function isOK() : bool { |
|
| 73 | + public function isOK () : bool { |
|
| 74 | 74 | return $this->status === self::STATUS_OK; |
| 75 | 75 | } |
| 76 | 76 | } |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare( strict_types=1 ); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace BotRiconferme\Request; |
| 4 | 4 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | /** |
| 12 | 12 | * @inheritDoc |
| 13 | 13 | */ |
| 14 | - protected function reallyMakeRequest( string $params ) : string { |
|
| 14 | + protected function reallyMakeRequest ( string $params ) : string { |
|
| 15 | 15 | $curl = curl_init(); |
| 16 | 16 | if ( $curl === false ) { |
| 17 | 17 | throw new APIRequestException( 'Cannot open cURL handler.' ); |
@@ -53,10 +53,10 @@ discard block |
||
| 53 | 53 | * @return int |
| 54 | 54 | * @internal Only used as CB for cURL |
| 55 | 55 | */ |
| 56 | - public function headersHandler( $ch, string $header ) : int { |
|
| 56 | + public function headersHandler ( $ch, string $header ) : int { |
|
| 57 | 57 | $bits = explode( ':', $header, 2 ); |
| 58 | - if ( trim( $bits[0] ) === 'Set-Cookie' ) { |
|
| 59 | - $this->newCookies[] = $bits[1]; |
|
| 58 | + if ( trim( $bits[ 0 ] ) === 'Set-Cookie' ) { |
|
| 59 | + $this->newCookies[ ] = $bits[ 1 ]; |
|
| 60 | 60 | } |
| 61 | 61 | // @phan-suppress-next-line PhanTypeMismatchReturn WTF? Why does phan thinks this is a string? |
| 62 | 62 | return strlen( $header ); |