@@ -136,14 +136,12 @@ |
||
| 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'); |
@@ -52,7 +52,7 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -55,7 +55,7 @@ |
||
| 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 | |
@@ -74,10 +74,10 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |