@@ -79,9 +79,9 @@ |
||
79 | 79 | $aliases = [':logger' => $logger, ':loop' => $eventLoop]; |
80 | 80 | |
81 | 81 | $injector->share($configuration) |
82 | - ->share($logger) |
|
83 | - ->share($eventDispatcher) |
|
84 | - ->share($eventLoop); |
|
82 | + ->share($logger) |
|
83 | + ->share($eventDispatcher) |
|
84 | + ->share($eventLoop); |
|
85 | 85 | |
86 | 86 | // Create managers |
87 | 87 | $statusManager = $injector->make('Jalle19\StatusManager\Manager\StatusManager', $aliases); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $eventDispatcher->addSubscriber($httpRequestManager); |
95 | 95 | |
96 | 96 | // Configure the event loop and start the application |
97 | - $eventLoop->addPeriodicTimer($configuration->getUpdateInterval(), function () use ($eventDispatcher) |
|
97 | + $eventLoop->addPeriodicTimer($configuration->getUpdateInterval(), function() use ($eventDispatcher) |
|
98 | 98 | { |
99 | 99 | // Emit an event on each tick |
100 | 100 | $eventDispatcher->dispatch(Events::MAIN_LOOP_TICK); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $manager->setConfiguration([ |
151 | 151 | 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', |
152 | 152 | //'classname' => 'Propel\\Runtime\\Connection\\DebugPDO', |
153 | - 'dsn' => 'sqlite:' . $configuration->getDatabasePath(), |
|
153 | + 'dsn' => 'sqlite:'.$configuration->getDatabasePath(), |
|
154 | 154 | 'user' => null, |
155 | 155 | 'password' => '', |
156 | 156 | 'attributes' => [ |
@@ -22,9 +22,9 @@ |
||
22 | 22 | public function hasConnection($instanceName, ConnectionStatus $connectionStatus) |
23 | 23 | { |
24 | 24 | return $this->filterByInstanceName($instanceName) |
25 | - ->filterByPeer($connectionStatus->peer) |
|
26 | - ->filterByStarted($connectionStatus->started) |
|
27 | - ->findOne() !== null; |
|
25 | + ->filterByPeer($connectionStatus->peer) |
|
26 | + ->filterByStarted($connectionStatus->started) |
|
27 | + ->findOne() !== null; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | public function hasChannel($instanceName, $channelName) |
22 | 22 | { |
23 | 23 | return $this->filterByInstanceName($instanceName)->filterByName($channelName) |
24 | - ->findOne() !== null; |
|
24 | + ->findOne() !== null; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | } |
@@ -23,9 +23,9 @@ |
||
23 | 23 | $this->setPrimaryKey($inputStatus->uuid); |
24 | 24 | |
25 | 25 | return $this->setInput($inputStatus->input) |
26 | - ->setWeight($inputStatus->weight) |
|
27 | - ->setNetwork(self::parseNetwork($inputStatus)) |
|
28 | - ->setMux(self::parseMux($inputStatus)); |
|
26 | + ->setWeight($inputStatus->weight) |
|
27 | + ->setNetwork(self::parseNetwork($inputStatus)) |
|
28 | + ->setMux(self::parseMux($inputStatus)); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 |
@@ -34,7 +34,7 @@ |
||
34 | 34 | */ |
35 | 35 | public function getFriendlyName() |
36 | 36 | { |
37 | - return $this->getNetwork() . '/' . $this->getMux(); |
|
37 | + return $this->getNetwork().'/'.$this->getMux(); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 |
@@ -34,9 +34,9 @@ discard block |
||
34 | 34 | $userId = $user !== null ? $user->getId() : null; |
35 | 35 | |
36 | 36 | return $this->filterByInstance($instance)->filterByUserId($userId) |
37 | - ->filterByChannel($channel) |
|
38 | - ->filterBySubscriptionId($subscription->id)->filterByStarted($subscription->start) |
|
39 | - ->findOne() !== null; |
|
37 | + ->filterByChannel($channel) |
|
38 | + ->filterBySubscriptionId($subscription->id)->filterByStarted($subscription->start) |
|
39 | + ->findOne() !== null; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | public function getNewestMatching($instanceName, $subscriptionId) |
50 | 50 | { |
51 | 51 | return $this->filterByInstanceName($instanceName) |
52 | - ->filterBySubscriptionId($subscriptionId) |
|
53 | - ->addDescendingOrderByColumn('started')->findOne(); |
|
52 | + ->filterBySubscriptionId($subscriptionId) |
|
53 | + ->addDescendingOrderByColumn('started')->findOne(); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 |
@@ -21,14 +21,14 @@ |
||
21 | 21 | { |
22 | 22 | /* @var EventSubscriberInterface|\PHPUnit_Framework_MockObject_MockObject $statusManager */ |
23 | 23 | $statusManager = $this->getMockBuilder('\Jalle19\StatusManager\Manager\StatusManager') |
24 | - ->setConstructorArgs([$this->configuration, $this->logger, $this->eventDispatcher]) |
|
25 | - ->setMethods(['onMainLoopStarted', 'onMainLoopTick']) |
|
26 | - ->getMock(); |
|
24 | + ->setConstructorArgs([$this->configuration, $this->logger, $this->eventDispatcher]) |
|
25 | + ->setMethods(['onMainLoopStarted', 'onMainLoopTick']) |
|
26 | + ->getMock(); |
|
27 | 27 | |
28 | 28 | $statusManager->expects($this->once()) |
29 | - ->method('onMainLoopStarted'); |
|
29 | + ->method('onMainLoopStarted'); |
|
30 | 30 | $statusManager->expects($this->once()) |
31 | - ->method('onMainLoopTick'); |
|
31 | + ->method('onMainLoopTick'); |
|
32 | 32 | |
33 | 33 | $this->eventDispatcher->addSubscriber($statusManager); |
34 | 34 | $this->eventDispatcher->dispatch(Events::MAIN_LOOP_STARTING); |
@@ -25,23 +25,23 @@ |
||
25 | 25 | { |
26 | 26 | /* @var EventSubscriberInterface|\PHPUnit_Framework_MockObject_MockObject|InstanceStateManager $instanceStateManager */ |
27 | 27 | $instanceStateManager = $this->getMockBuilder('\Jalle19\StatusManager\Manager\InstanceStateManager') |
28 | - ->setConstructorArgs([$this->configuration, $this->logger, $this->eventDispatcher]) |
|
29 | - ->setMethods([ |
|
30 | - 'onInstanceStatusCollectionRequest', |
|
31 | - 'onInstanceReachable', |
|
32 | - 'onInstanceUnreachable', |
|
33 | - 'onInstanceMaybeReachable', |
|
34 | - ]) |
|
35 | - ->getMock(); |
|
28 | + ->setConstructorArgs([$this->configuration, $this->logger, $this->eventDispatcher]) |
|
29 | + ->setMethods([ |
|
30 | + 'onInstanceStatusCollectionRequest', |
|
31 | + 'onInstanceReachable', |
|
32 | + 'onInstanceUnreachable', |
|
33 | + 'onInstanceMaybeReachable', |
|
34 | + ]) |
|
35 | + ->getMock(); |
|
36 | 36 | |
37 | 37 | $instanceStateManager->expects($this->once()) |
38 | - ->method('onInstanceStatusCollectionRequest'); |
|
38 | + ->method('onInstanceStatusCollectionRequest'); |
|
39 | 39 | $instanceStateManager->expects($this->once()) |
40 | - ->method('onInstanceReachable'); |
|
40 | + ->method('onInstanceReachable'); |
|
41 | 41 | $instanceStateManager->expects($this->once()) |
42 | - ->method('onInstanceUnreachable'); |
|
42 | + ->method('onInstanceUnreachable'); |
|
43 | 43 | $instanceStateManager->expects($this->once()) |
44 | - ->method('onInstanceMaybeReachable'); |
|
44 | + ->method('onInstanceMaybeReachable'); |
|
45 | 45 | |
46 | 46 | // Start triggering events and assert that the instance state is as expected |
47 | 47 | $this->eventDispatcher->addSubscriber($instanceStateManager); |
@@ -52,7 +52,7 @@ |
||
52 | 52 | } |
53 | 53 | catch (PropelException $e) |
54 | 54 | { |
55 | - throw new RequestFailedException('A database error occured: ' . $e->getMessage()); |
|
55 | + throw new RequestFailedException('A database error occured: '.$e->getMessage()); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | return false; |
@@ -127,8 +127,8 @@ |
||
127 | 127 | $ignoredUsers = $this->configuration->getInstanceByName($instanceName)->getIgnoredUsers(); |
128 | 128 | |
129 | 129 | return UserQuery::create() |
130 | - ->filterIgnoredUsers($ignoredUsers) |
|
131 | - ->findByInstanceName($instanceName)->getArrayCopy(); |
|
130 | + ->filterIgnoredUsers($ignoredUsers) |
|
131 | + ->findByInstanceName($instanceName)->getArrayCopy(); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | } |
@@ -51,7 +51,7 @@ |
||
51 | 51 | // Check that all mandatory values are defined |
52 | 52 | foreach (self::$mandatoryValues as $mandatoryValue) |
53 | 53 | if (!isset($this->_configuration[$mandatoryValue]) || ($this->_configuration[$mandatoryValue] != '0' && empty($this->_configuration[$mandatoryValue]))) |
54 | - throw new InvalidConfigurationException('Mandatory configuration value "' . $mandatoryValue . '" is missing'); |
|
54 | + throw new InvalidConfigurationException('Mandatory configuration value "'.$mandatoryValue.'" is missing'); |
|
55 | 55 | |
56 | 56 | if (!is_readable($this->_configuration['database_path'])) |
57 | 57 | throw new InvalidConfigurationException('The database path does not exist or is not writable'); |