@@ -367,7 +367,7 @@ |
||
| 367 | 367 | */ |
| 368 | 368 | public function unmute($channelId, $direction) |
| 369 | 369 | { |
| 370 | - $uri = "/channels/$channelId/mute?direction=".$this->client->getEndpoint()->jsonEncode($direction); |
|
| 370 | + $uri = "/channels/$channelId/mute?direction=" . $this->client->getEndpoint()->jsonEncode($direction); |
|
| 371 | 371 | try { |
| 372 | 372 | $this->client->getEndpoint()->delete($uri); |
| 373 | 373 | } catch (Pest_NotFound $e) { |
@@ -76,18 +76,18 @@ |
||
| 76 | 76 | $factory = new Factory($this->eventLoop); |
| 77 | 77 | |
| 78 | 78 | return $factory->createClient($address) |
| 79 | - ->then(function (Client $client) { |
|
| 79 | + ->then(function(Client $client) { |
|
| 80 | 80 | $this->amiClient = $client; |
| 81 | 81 | $this->actionSender = new ActionSender($client); |
| 82 | 82 | $this->actionSender->events(true); |
| 83 | - $client->on('close', function () { |
|
| 83 | + $client->on('close', function() { |
|
| 84 | 84 | $this->logger->debug('AMI connection closed'); |
| 85 | 85 | }); |
| 86 | - $client->on('event', function (Event $event) { |
|
| 86 | + $client->on('event', function(Event $event) { |
|
| 87 | 87 | $this->wsClient->emit($event->getName(), (array)$event); |
| 88 | 88 | }); |
| 89 | - }, function (\Exception $e) { |
|
| 90 | - $this->logger->err('Connection error: '.$e->getMessage()); |
|
| 89 | + }, function(\Exception $e) { |
|
| 90 | + $this->logger->err('Connection error: ' . $e->getMessage()); |
|
| 91 | 91 | }); |
| 92 | 92 | } |
| 93 | 93 | |
@@ -148,15 +148,15 @@ |
||
| 148 | 148 | $apiKey = $queryParts['api_key']; |
| 149 | 149 | list($username, $password) = explode(':', $apiKey); |
| 150 | 150 | |
| 151 | - $this->endpoint = new PestJSON('http://'.$host.':'.$port.dirname($path)); |
|
| 151 | + $this->endpoint = new PestJSON('http://' . $host . ':' . $port . dirname($path)); |
|
| 152 | 152 | $this->endpoint->setupAuth($username, $password, 'basic'); |
| 153 | 153 | |
| 154 | 154 | $this->wsClient = new WebSocket($address, $this->eventLoop, $this->logger); |
| 155 | 155 | |
| 156 | - $this->wsClient->on("message", function (WebSocketMessage $rawMessage) { |
|
| 156 | + $this->wsClient->on("message", function(WebSocketMessage $rawMessage) { |
|
| 157 | 157 | $message = new Message($rawMessage->getData()); |
| 158 | 158 | |
| 159 | - $eventType = '\\phparia\\Events\\'.$message->getType(); |
|
| 159 | + $eventType = '\\phparia\\Events\\' . $message->getType(); |
|
| 160 | 160 | if (class_exists($eventType)) { |
| 161 | 161 | $event = new $eventType($this, $rawMessage->getData()); |
| 162 | 162 | } else { |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | */ |
| 131 | 131 | public function onBridgeCreated(callable $callback) |
| 132 | 132 | { |
| 133 | - $this->on(Event::BRIDGE_CREATED.'_'.$this->getId(), $callback); |
|
| 133 | + $this->on(Event::BRIDGE_CREATED . '_' . $this->getId(), $callback); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | /** |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | */ |
| 139 | 139 | public function onceBridgeCreated(callable $callback) |
| 140 | 140 | { |
| 141 | - $this->once(Event::BRIDGE_CREATED.'_'.$this->getId(), $callback); |
|
| 141 | + $this->once(Event::BRIDGE_CREATED . '_' . $this->getId(), $callback); |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | /** |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | */ |
| 147 | 147 | public function onBridgeDestroyed(callable $callback) |
| 148 | 148 | { |
| 149 | - $this->on(Event::BRIDGE_DESTROYED.'_'.$this->getId(), $callback); |
|
| 149 | + $this->on(Event::BRIDGE_DESTROYED . '_' . $this->getId(), $callback); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | /** |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | public function onceBridgeDestroyed(callable $callback) |
| 156 | 156 | { |
| 157 | - $this->once(Event::BRIDGE_DESTROYED.'_'.$this->getId(), $callback); |
|
| 157 | + $this->once(Event::BRIDGE_DESTROYED . '_' . $this->getId(), $callback); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | /** |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | */ |
| 163 | 163 | public function onBridgeMerged(callable $callback) |
| 164 | 164 | { |
| 165 | - $this->on(Event::BRIDGE_MERGED.'_'.$this->getId(), $callback); |
|
| 165 | + $this->on(Event::BRIDGE_MERGED . '_' . $this->getId(), $callback); |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | /** |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | */ |
| 171 | 171 | public function onceBridgeMerged(callable $callback) |
| 172 | 172 | { |
| 173 | - $this->once(Event::BRIDGE_MERGED.'_'.$this->getId(), $callback); |
|
| 173 | + $this->once(Event::BRIDGE_MERGED . '_' . $this->getId(), $callback); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /** |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | */ |
| 63 | 63 | public function once($event, callable $listener) |
| 64 | 64 | { |
| 65 | - $onceListener = function () use (&$onceListener, $event, $listener) { |
|
| 65 | + $onceListener = function() use (&$onceListener, $event, $listener) { |
|
| 66 | 66 | $this->removeListener($event, $onceListener); |
| 67 | 67 | |
| 68 | 68 | call_user_func_array($listener, func_get_args()); |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$loader = @include __DIR__.'/vendor/autoload.php'; |
|
| 3 | +$loader = @include __DIR__ . '/vendor/autoload.php'; |
|
| 4 | 4 | if (!$loader) { |
| 5 | - $loader = require __DIR__.'./vendor/autoload.php'; |
|
| 5 | + $loader = require __DIR__ . './vendor/autoload.php'; |
|
| 6 | 6 | } |
| 7 | 7 | $loader->addPsr4('phparia\\Tests\\Functional\\', __DIR__); |
@@ -115,7 +115,7 @@ |
||
| 115 | 115 | */ |
| 116 | 116 | public function unsubscribe($applicationName, $eventSource) |
| 117 | 117 | { |
| 118 | - $uri = "/applications/$applicationName/subscription?eventSource=".$this->client->getEndpoint()->jsonEncode($eventSource); |
|
| 118 | + $uri = "/applications/$applicationName/subscription?eventSource=" . $this->client->getEndpoint()->jsonEncode($eventSource); |
|
| 119 | 119 | try { |
| 120 | 120 | $response = $this->client->getEndpoint()->delete($uri); |
| 121 | 121 | } catch (Pest_BadRequest $e) { // Missing parameter; event source scheme not recognized. |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | parent::offsetSet($offset, $value); |
| 47 | 47 | |
| 48 | 48 | // Remove playbacks when they are done playing |
| 49 | - $value->oncePlaybackFinished(function () use ($offset) { |
|
| 49 | + $value->oncePlaybackFinished(function() use ($offset) { |
|
| 50 | 50 | echo 'got here'; |
| 51 | 51 | die; |
| 52 | 52 | $this->offsetUnset($offset); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | // Remove playbacks when they are done playing |
| 67 | 67 | $this->phparia->getWsClient()->once('PlaybackFinished', |
| 68 | - function (PlaybackFinished $playbackFinished) use ($value) { |
|
| 68 | + function(PlaybackFinished $playbackFinished) use ($value) { |
|
| 69 | 69 | echo 'here'; |
| 70 | 70 | die; |
| 71 | 71 | if ($playbackFinished->getPlayback()->getId() === $value->getId()) { |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | public function onApplicationReplaced(callable $callback) |
| 100 | 100 | { |
| 101 | - $this->on(Event::APPLICATION_REPLACED.'_'.$this->getName(), $callback); |
|
| 101 | + $this->on(Event::APPLICATION_REPLACED . '_' . $this->getName(), $callback); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | public function onceApplicationReplaced(callable $callback) |
| 108 | 108 | { |
| 109 | - $this->once(Event::APPLICATION_REPLACED.'_'.$this->getName(), $callback); |
|
| 109 | + $this->once(Event::APPLICATION_REPLACED . '_' . $this->getName(), $callback); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | /** |