Passed
Push — master ( a192f6...3a1f1a )
by Daimona
02:01
created
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
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	 * @param Wiki $wiki
59 59
 	 * @param MessageProvider $mp
60 60
 	 */
61
-	public function __construct( LoggerInterface $logger, Wiki $wiki, MessageProvider $mp ) {
61
+	public function __construct ( LoggerInterface $logger, Wiki $wiki, MessageProvider $mp ) {
62 62
 		$this->logger = $logger;
63 63
 		$this->wiki = $wiki;
64 64
 		$this->messageProvider = $mp;
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 * @param string|null $name Only used in MODE_TASK and MODE_SUBTASK
73 73
 	 * @return TaskResult
74 74
 	 */
75
-	public function run( string $mode, string $name = null ) : TaskResult {
75
+	public function run ( string $mode, string $name = null ) : TaskResult {
76 76
 		if ( $mode === self::MODE_COMPLETE ) {
77 77
 			return $this->runAllTasks();
78 78
 		} elseif ( $name === null ) {
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 *
88 88
 	 * @return TaskResult
89 89
 	 */
90
-	protected function runAllTasks() : TaskResult {
90
+	protected function runAllTasks () : TaskResult {
91 91
 		$orderedList = [
92 92
 			'update-list',
93 93
 			'start-new',
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 * @param string $name
110 110
 	 * @return TaskResult
111 111
 	 */
112
-	protected function runTask( string $name ) : TaskResult {
112
+	protected function runTask ( string $name ) : TaskResult {
113 113
 		if ( !isset( self::TASKS_MAP[ $name ] ) ) {
114 114
 			throw new \InvalidArgumentException( "'$name' is not a valid task." );
115 115
 		}
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 	 * @param string $name
124 124
 	 * @return TaskResult
125 125
 	 */
126
-	protected function runSubtask( string $name ) : TaskResult {
126
+	protected function runSubtask ( string $name ) : TaskResult {
127 127
 		if ( !isset( self::SUBTASKS_MAP[ $name ] ) ) {
128 128
 			throw new \InvalidArgumentException( "'$name' is not a valid subtask." );
129 129
 		}
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	 * @param string $name
139 139
 	 * @return Task
140 140
 	 */
141
-	private function getTaskInstance( string $name ) : Task {
141
+	private function getTaskInstance ( string $name ) : Task {
142 142
 		$class = self::TASKS_MAP[ $name ];
143 143
 		/** @var Task $ret */
144 144
 		$ret = new $class( $this->logger, $this->wiki, $this->provider, $this->messageProvider );
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	 * @param string $class
152 152
 	 * @return Subtask
153 153
 	 */
154
-	private function getSubtaskInstance( string $class ) : Subtask {
154
+	private function getSubtaskInstance ( string $class ) : Subtask {
155 155
 		/** @var Subtask $ret */
156 156
 		$ret = new $class( $this->logger, $this->wiki, $this->provider, $this->messageProvider );
157 157
 		return $ret;
Please login to merge, or discard this patch.
includes/Bot.php 1 patch
Spacing   +7 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
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	 * @param Wiki $wiki
22 22
 	 * @param MessageProvider $mp
23 23
 	 */
24
-	public function __construct( LoggerInterface $logger, Wiki $wiki, MessageProvider $mp ) {
24
+	public function __construct ( LoggerInterface $logger, Wiki $wiki, MessageProvider $mp ) {
25 25
 		$this->logger = $logger;
26 26
 		$this->wiki = $wiki;
27 27
 		$this->messageProvider = $mp;
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	 * @param string $mode
34 34
 	 * @param string|null $name
35 35
 	 */
36
-	private function run( string $mode = TaskManager::MODE_COMPLETE, string $name = null ) : void {
36
+	private function run ( string $mode = TaskManager::MODE_COMPLETE, string $name = null ) : void {
37 37
 		$activity = $mode === TaskManager::MODE_COMPLETE ? TaskManager::MODE_COMPLETE : "$mode $name";
38 38
 		$this->logger->info( "Running $activity" );
39 39
 		$manager = new TaskManager( $this->logger, $this->wiki, $this->messageProvider );
@@ -41,8 +41,7 @@  discard block
 block discarded – undo
41 41
 		$base = "Execution of $activity";
42 42
 		if ( $res->isOK() ) {
43 43
 			$msg = $res->getStatus() === TaskResult::STATUS_NOTHING ?
44
-				': nothing to do' :
45
-				' completed successfully';
44
+				': nothing to do' : ' completed successfully';
46 45
 			$this->logger->info( $base . $msg );
47 46
 		} else {
48 47
 			$this->logger->error( "$base failed.\n$res" );
@@ -52,7 +51,7 @@  discard block
 block discarded – undo
52 51
 	/**
53 52
 	 * Entry point for the whole process
54 53
 	 */
55
-	public function runAll() : void {
54
+	public function runAll () : void {
56 55
 		$this->run();
57 56
 	}
58 57
 
@@ -61,7 +60,7 @@  discard block
 block discarded – undo
61 60
 	 *
62 61
 	 * @param string $task
63 62
 	 */
64
-	public function runTask( string $task ) : void {
63
+	public function runTask ( string $task ) : void {
65 64
 		$this->run( TaskManager::MODE_TASK, $task );
66 65
 	}
67 66
 
@@ -70,7 +69,7 @@  discard block
 block discarded – undo
70 69
 	 *
71 70
 	 * @param string $subtask
72 71
 	 */
73
-	public function runSubtask( string $subtask ) : void {
72
+	public function runSubtask ( string $subtask ) : void {
74 73
 		$this->run( TaskManager::MODE_SUBTASK, $subtask );
75 74
 	}
76 75
 }
Please login to merge, or discard this patch.