Passed
Push — master ( 3decfe...46f54c )
by Daimona
01:32
created
includes/Exception/TaskException.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/Exception/APIRequestException.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/Exception/ConfigException.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/Exception/LoginException.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/Logger.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;
4 4
 
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
includes/Exception/ProtectedPageException.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\Exception;
4 4
 
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
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 {
Please login to merge, or discard this patch.
includes/Exception/MissingPageException.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\Exception;
4 4
 
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
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 {
Please login to merge, or discard this patch.
includes/TaskManager.php 1 patch
Spacing   +8 added lines, -8 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;
4 4
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	/**
32 32
 	 * Should only be used for debugging purpose.
33 33
 	 */
34
-	public static function resetLastRunDate() {
34
+	public static function resetLastRunDate () {
35 35
 		file_put_contents( self::LOG_FILE, '' );
36 36
 	}
37 37
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	 * @param string|null $taskName Only used in MODE_SINGLE
43 43
 	 * @return TaskResult
44 44
 	 */
45
-	public function run( int $mode, string $taskName = null ) : TaskResult {
45
+	public function run ( int $mode, string $taskName = null ) : TaskResult {
46 46
 		$this->provider = new TaskDataProvider;
47 47
 		if ( $mode === self::MODE_COMPLETE ) {
48 48
 			return $this->runAllTasks();
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	/**
57 57
 	 * @return TaskResult
58 58
 	 */
59
-	protected function runAllTasks() : TaskResult {
59
+	protected function runAllTasks () : TaskResult {
60 60
 		if ( self::getLastFullRunDate() === date( 'd/m/Y' ) ) {
61 61
 			// Really avoid executing twice the same day
62 62
 			return new TaskResult( TaskResult::STATUS_ERROR, [ 'A full run was already executed today.' ] );
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 * Get the last execution date to ensure no more than one full run is executed every day
87 87
 	 * @return string|null d/m/Y or null if no last run registered
88 88
 	 */
89
-	public static function getLastFullRunDate() : ?string {
89
+	public static function getLastFullRunDate () : ?string {
90 90
 		if ( file_exists( self::LOG_FILE ) ) {
91 91
 			return file_get_contents( self::LOG_FILE ) ?: null;
92 92
 		} else {
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	 * @param string $task Defined in self::TASKS_MAP
99 99
 	 * @return TaskResult
100 100
 	 */
101
-	protected function runTask( string $task ) : TaskResult {
101
+	protected function runTask ( string $task ) : TaskResult {
102 102
 		if ( !isset( self::TASKS_MAP[ $task ] ) ) {
103 103
 			throw new \InvalidArgumentException( "'$task' is not a valid task." );
104 104
 		}
@@ -113,11 +113,11 @@  discard block
 block discarded – undo
113 113
 	 * @param string $class
114 114
 	 * @return Task
115 115
 	 */
116
-	private function getTaskInstance( string $class ) : Task {
116
+	private function getTaskInstance ( string $class ) : Task {
117 117
 		return new $class( $this->provider );
118 118
 	}
119 119
 
120
-	public static function setLastFullRunDate() {
120
+	public static function setLastFullRunDate () {
121 121
 		file_put_contents( self::LOG_FILE, date( 'd/m/Y' ) );
122 122
 	}
123 123
 }
Please login to merge, or discard this patch.
includes/TaskResult.php 1 patch
Spacing   +9 added lines, -9 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;
4 4
 
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.