@@ -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); |
@@ -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,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); |
@@ -22,12 +22,12 @@ |
||
| 22 | 22 | $mock = $this->getMockForTrait('\Jalle19\StatusManager\Database\LimitTrait'); |
| 23 | 23 | |
| 24 | 24 | $mock->expects($this->once()) |
| 25 | - ->method('limit'); |
|
| 25 | + ->method('limit'); |
|
| 26 | 26 | |
| 27 | 27 | $mock->filterByLimit(10); |
| 28 | 28 | |
| 29 | 29 | $mock->expects($this->never()) |
| 30 | - ->method('limit'); |
|
| 30 | + ->method('limit'); |
|
| 31 | 31 | |
| 32 | 32 | $mock->filterByLimit(null); |
| 33 | 33 | } |
@@ -22,11 +22,11 @@ |
||
| 22 | 22 | { |
| 23 | 23 | /* @var \PHPUnit_Framework_MockObject_MockObject|SubscriptionQuery $mock */ |
| 24 | 24 | $mock = $this->getMockBuilder(SubscriptionQuery::class) |
| 25 | - ->setMethods(['filterByStopped']) |
|
| 26 | - ->getMock(); |
|
| 25 | + ->setMethods(['filterByStopped']) |
|
| 26 | + ->getMock(); |
|
| 27 | 27 | |
| 28 | 28 | $mock->expects($expects) |
| 29 | - ->method('filterByStopped'); |
|
| 29 | + ->method('filterByStopped'); |
|
| 30 | 30 | |
| 31 | 31 | $mock->filterByTimeFrame(new TimeFrame($timeFrame)); |
| 32 | 32 | } |