Completed
Push — master ( b2dfe1...1412d2 )
by Sam
02:32
created
src/cli/Database/InputQuery.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@
 block discarded – undo
27 27
 	public function filterBySubscriptionStatus($instanceName, SubscriptionStatus $status)
28 28
 	{
29 29
 		return $this->filterByInstanceName($instanceName)
30
-		            ->filterByNetwork(Subscription::parseNetwork($status))
31
-		            ->filterByMux(Subscription::parseMux($status))
32
-		            ->addDescendingOrderByColumn('started');
30
+					->filterByNetwork(Subscription::parseNetwork($status))
31
+					->filterByMux(Subscription::parseMux($status))
32
+					->addDescendingOrderByColumn('started');
33 33
 	}
34 34
 
35 35
 }
Please login to merge, or discard this patch.
src/cli/Manager/PersistenceManager.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -251,7 +251,7 @@
 block discarded – undo
251 251
 
252 252
 
253 253
 	/**
254
-	 * @param                  $instanceName
254
+	 * @param                  string $instanceName
255 255
 	 * @param ConnectionStatus $connectionStatus
256 256
 	 *
257 257
 	 * @return bool whether the connection exists in the database
Please login to merge, or discard this patch.
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
 		$user->save();
75 75
 
76 76
 		$this->getApplication()->getLogger()
77
-		     ->info('Stored new special user (instance: {instanceName}, user: {userName})', [
78
-			     'instanceName' => $instance->getHostname(),
79
-			     'userName'     => $user->getName(),
80
-		     ]);
77
+			 ->info('Stored new special user (instance: {instanceName}, user: {userName})', [
78
+				 'instanceName' => $instance->getHostname(),
79
+				 'userName'     => $user->getName(),
80
+			 ]);
81 81
 	}
82 82
 
83 83
 
@@ -100,13 +100,13 @@  discard block
 block discarded – undo
100 100
 			$this->onUserSeen($instanceName, $connectionStatus->user);
101 101
 
102 102
 			$user = UserQuery::create()->filterByInstanceName($instanceName)->filterByName($connectionStatus->user)
103
-			                 ->findOne();
103
+							 ->findOne();
104 104
 		}
105 105
 
106 106
 		$connection = new Connection();
107 107
 		$connection->setInstanceName($instanceName)->setPeer($connectionStatus->peer)
108
-		           ->setUser($user)
109
-		           ->setStarted($connectionStatus->started)->setType($connectionStatus->type)->save();
108
+				   ->setUser($user)
109
+				   ->setStarted($connectionStatus->started)->setType($connectionStatus->type)->save();
110 110
 
111 111
 		$this->getApplication()->getLogger()->info('Stored new connection (instance: {instanceName}, peer: {peer})', [
112 112
 			'instanceName' => $instanceName,
@@ -135,20 +135,20 @@  discard block
 block discarded – undo
135 135
 		$input = new Input();
136 136
 		$input->setPrimaryKey($inputStatus->uuid);
137 137
 		$input->setInstanceName($instanceName)
138
-		      ->setStarted(new \DateTime())
139
-		      ->setInput($inputStatus->input)
140
-		      ->setWeight($inputStatus->weight)
141
-		      ->setNetwork(Input::parseNetwork($inputStatus))
142
-		      ->setMux(Input::parseMux($inputStatus))->save();
138
+			  ->setStarted(new \DateTime())
139
+			  ->setInput($inputStatus->input)
140
+			  ->setWeight($inputStatus->weight)
141
+			  ->setNetwork(Input::parseNetwork($inputStatus))
142
+			  ->setMux(Input::parseMux($inputStatus))->save();
143 143
 
144 144
 		$this->getApplication()->getLogger()
145
-		     ->info('Stored new input (instance: {instanceName}, network: {network}, mux: {mux}, weight: {weight})',
146
-			     [
147
-				     'instanceName' => $instanceName,
148
-				     'network'      => $input->getNetwork(),
149
-				     'mux'          => $input->getMux(),
150
-				     'weight'       => $input->getWeight(),
151
-			     ]);
145
+			 ->info('Stored new input (instance: {instanceName}, network: {network}, mux: {mux}, weight: {weight})',
146
+				 [
147
+					 'instanceName' => $instanceName,
148
+					 'network'      => $input->getNetwork(),
149
+					 'mux'          => $input->getMux(),
150
+					 'weight'       => $input->getWeight(),
151
+				 ]);
152 152
 	}
153 153
 
154 154
 
@@ -193,27 +193,27 @@  discard block
 block discarded – undo
193 193
 		if ($input === null)
194 194
 		{
195 195
 			$this->getApplication()->getLogger()
196
-			     ->warning('Got subscription that cannot be tied to an input ({instanceName}, user: {userName}, channel: {channelName})',
197
-				     [
198
-					     'instanceName' => $instanceName,
199
-					     'userName'     => $user !== null ? $user->getName() : 'N/A',
200
-					     'channelName'  => $channel->getName(),
201
-				     ]);
196
+				 ->warning('Got subscription that cannot be tied to an input ({instanceName}, user: {userName}, channel: {channelName})',
197
+					 [
198
+						 'instanceName' => $instanceName,
199
+						 'userName'     => $user !== null ? $user->getName() : 'N/A',
200
+						 'channelName'  => $channel->getName(),
201
+					 ]);
202 202
 		}
203 203
 
204 204
 		$subscription = new Subscription();
205 205
 		$subscription->setInstance($instance)->setInput($input)->setUser($user)->setChannel($channel)
206
-		             ->setSubscriptionId($status->id)->setStarted($status->start)->setTitle($status->title)
207
-		             ->setService($status->service);
206
+					 ->setSubscriptionId($status->id)->setStarted($status->start)->setTitle($status->title)
207
+					 ->setService($status->service);
208 208
 		$subscription->save();
209 209
 
210 210
 		$this->getApplication()->getLogger()
211
-		     ->info('Stored new subscription (instance: {instanceName}, user: {userName}, channel: {channelName})',
212
-			     [
213
-				     'instanceName' => $instanceName,
214
-				     'userName'     => $user !== null ? $user->getName() : 'N/A',
215
-				     'channelName'  => $channel->getName(),
216
-			     ]);
211
+			 ->info('Stored new subscription (instance: {instanceName}, user: {userName}, channel: {channelName})',
212
+				 [
213
+					 'instanceName' => $instanceName,
214
+					 'userName'     => $user !== null ? $user->getName() : 'N/A',
215
+					 'channelName'  => $channel->getName(),
216
+				 ]);
217 217
 	}
218 218
 
219 219
 
@@ -231,18 +231,18 @@  discard block
 block discarded – undo
231 231
 
232 232
 		// Find the latest matching subscription
233 233
 		$subscription = SubscriptionQuery::create()->filterByInstanceName($instanceName)
234
-		                                 ->filterBySubscriptionId($stateChange->getSubscriptionId())
235
-		                                 ->addDescendingOrderByColumn('started')->findOne();
234
+										 ->filterBySubscriptionId($stateChange->getSubscriptionId())
235
+										 ->addDescendingOrderByColumn('started')->findOne();
236 236
 
237 237
 		// EPG grab subscriptions are not stored so we don't want to log these with a high level
238 238
 		if ($subscription === null)
239 239
 		{
240 240
 			$this->getApplication()->getLogger()
241
-			     ->debug('Got subscription stop without a matching start (instance: {instanceName}, subscription: {subscriptionId})',
242
-				     [
243
-					     'instanceName'   => $instanceName,
244
-					     'subscriptionId' => $stateChange->getSubscriptionId(),
245
-				     ]);
241
+				 ->debug('Got subscription stop without a matching start (instance: {instanceName}, subscription: {subscriptionId})',
242
+					 [
243
+						 'instanceName'   => $instanceName,
244
+						 'subscriptionId' => $stateChange->getSubscriptionId(),
245
+					 ]);
246 246
 
247 247
 			return;
248 248
 		}
@@ -254,12 +254,12 @@  discard block
 block discarded – undo
254 254
 		$channel = $subscription->getChannel();
255 255
 
256 256
 		$this->getApplication()->getLogger()
257
-		     ->info('Stored subscription stop (instance: {instanceName}, user: {userName}, channel: {channelName})',
258
-			     [
259
-				     'instanceName' => $instanceName,
260
-				     'userName'     => $user !== null ? $user->getName() : 'N/A',
261
-				     'channelName'  => $channel->getName(),
262
-			     ]);
257
+			 ->info('Stored subscription stop (instance: {instanceName}, user: {userName}, channel: {channelName})',
258
+				 [
259
+					 'instanceName' => $instanceName,
260
+					 'userName'     => $user !== null ? $user->getName() : 'N/A',
261
+					 'channelName'  => $channel->getName(),
262
+				 ]);
263 263
 	}
264 264
 
265 265
 
@@ -301,10 +301,10 @@  discard block
 block discarded – undo
301 301
 		$channel->save();
302 302
 
303 303
 		$this->getApplication()->getLogger()
304
-		     ->info('Stored new channel (instance: {instanceName}, name: {channelName})', [
305
-			     'instanceName' => $instanceName,
306
-			     'channelName'  => $channelName,
307
-		     ]);
304
+			 ->info('Stored new channel (instance: {instanceName}, name: {channelName})', [
305
+				 'instanceName' => $instanceName,
306
+				 'channelName'  => $channelName,
307
+			 ]);
308 308
 	}
309 309
 
310 310
 
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 	private function hasConnection($instanceName, ConnectionStatus $connectionStatus)
329 329
 	{
330 330
 		return ConnectionQuery::create()->filterByInstanceName($instanceName)->filterByPeer($connectionStatus->peer)
331
-		                      ->filterByStarted($connectionStatus->started)->findOne() !== null;
331
+							  ->filterByStarted($connectionStatus->started)->findOne() !== null;
332 332
 	}
333 333
 
334 334
 
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 	private function hasChannel($instanceName, $channelName)
365 365
 	{
366 366
 		return ChannelQuery::create()->filterByInstanceName($instanceName)->filterByName($channelName)
367
-		                   ->findOne() !== null;
367
+						   ->findOne() !== null;
368 368
 	}
369 369
 
370 370
 
@@ -387,9 +387,9 @@  discard block
 block discarded – undo
387 387
 		$userId = $user !== null ? $user->getId() : null;
388 388
 
389 389
 		return SubscriptionQuery::create()->filterByInstance($instance)->filterByUserId($userId)
390
-		                        ->filterByChannel($channel)
391
-		                        ->filterBySubscriptionId($subscription->id)->filterByStarted($subscription->start)
392
-		                        ->findOne() !== null;
390
+								->filterByChannel($channel)
391
+								->filterBySubscriptionId($subscription->id)->filterByStarted($subscription->start)
392
+								->findOne() !== null;
393 393
 	}
394 394
 
395 395
 }
Please login to merge, or discard this patch.
src/cli/Manager/WebSocketManager.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -136,14 +136,12 @@
 block discarded – undo
136 136
 			$logger->debug('Got message from client (type: {messageType})', [
137 137
 				'messageType' => $message->getType(),
138 138
 			]);
139
-		}
140
-		catch (MalformedRequestException $e)
139
+		} catch (MalformedRequestException $e)
141 140
 		{
142 141
 			$logger->error('Got malformed message from client (reason: {reason})', [
143 142
 				'reason' => $e->getMessage(),
144 143
 			]);
145
-		}
146
-		catch (UnknownRequestException $e)
144
+		} catch (UnknownRequestException $e)
147 145
 		{
148 146
 			// The server itself sometimes sends out messages that are received here, hence debug
149 147
 			$logger->debug('Got unknown message from client');
Please login to merge, or discard this patch.
src/cli/Manager/InstanceStateManager.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	{
53 53
 		// Respond with the instances and their current state
54 54
 		$this->getApplication()->getEventDispatcher()
55
-		     ->dispatch(Events::INSTANCE_COLLECTION, new InstanceCollectionEvent($this->_instances));
55
+			 ->dispatch(Events::INSTANCE_COLLECTION, new InstanceCollectionEvent($this->_instances));
56 56
 	}
57 57
 
58 58
 
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
 		if ($instanceState->getReachability() === InstanceState::MAYBE_REACHABLE)
71 71
 		{
72 72
 			$this->getApplication()->getLogger()
73
-			     ->info('Instance {instanceName} is now reachable, will start polling for updates', [
74
-				     'instanceName' => $instance->getName(),
75
-			     ]);
73
+				 ->info('Instance {instanceName} is now reachable, will start polling for updates', [
74
+					 'instanceName' => $instance->getName(),
75
+				 ]);
76 76
 
77 77
 			$instanceState->setReachability(InstanceState::REACHABLE);
78 78
 		}
Please login to merge, or discard this patch.
src/cli/Manager/StatusManager.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 			]);
56 56
 
57 57
 			$this->getApplication()->getEventDispatcher()
58
-			     ->dispatch(Events::INSTANCE_SEEN, new InstanceSeenEvent($instance));
58
+				 ->dispatch(Events::INSTANCE_SEEN, new InstanceSeenEvent($instance));
59 59
 		}
60 60
 	}
61 61
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -224,8 +224,7 @@
 block discarded – undo
224 224
 
225 225
 					$this->_eventDispatcher->dispatch(Events::INSTANCE_STATE_REACHABLE,
226 226
 						new InstanceStateEvent($instance));
227
-				}
228
-				catch (\Exception $e)
227
+				} catch (\Exception $e)
229 228
 				{
230 229
 					$this->_eventDispatcher->dispatch(Events::INSTANCE_STATE_UNREACHABLE,
231 230
 						new InstanceStateEvent($instance));
Please login to merge, or discard this patch.