Skip to content

Commit e8c50d2

Browse files
committed
CS fixes
1 parent 02b0979 commit e8c50d2

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

src/ApiSettings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static function createUrl(string $appId, string $cluster = null): string
4141
'version' => ApiSettings::getVersion(),
4242
];
4343

44-
$host = ($cluster) ? "ws-{$cluster}.pusher.com" : 'ws.pusherapp.com';
44+
$host = ($cluster !== null) ? "ws-{$cluster}.pusher.com" : 'ws.pusherapp.com';
4545

4646
return 'wss://'.$host.'/app/' .
4747
$appId .

src/AsyncClient.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,12 @@ public function __construct(Subject $client)
8383
* @throws \InvalidArgumentException
8484
* @return AsyncClient
8585
*/
86-
public static function create(LoopInterface $loop, string $app, Resolver $resolver = null, $cluster = null): AsyncClient
87-
{
86+
public static function create(
87+
LoopInterface $loop,
88+
string $app,
89+
Resolver $resolver = null,
90+
string $cluster = null
91+
): AsyncClient {
8892
try {
8993
Scheduler::setDefaultFactory(function () use ($loop) {
9094
return new Scheduler\EventLoopScheduler($loop);

tests/ApiSettingsTest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,16 @@ public function testGetVersionDefault()
4040

4141
public function testCreateUrl()
4242
{
43-
$expectedUrl = 'wss://ws.pusherapp.com/app/barBaz?client=api-clients%2Fpusher+%28https%3A%2F%2Fphp-api-clients.org%2Fclients%2Fpusher%29&protocol=7&version=' . ApiSettings::getVersion();
43+
$expectedUrl = 'wss://ws.pusherapp.com/app/barBaz?' .
44+
'client=api-clients%2Fpusher+%28https%3A%2F%2Fphp-api-clients.org%2Fclients%2Fpusher%29&' .
45+
'protocol=7&version=' . ApiSettings::getVersion();
4446

4547
self::assertSame($expectedUrl, ApiSettings::createUrl('barBaz'));
4648

47-
$expectedUrl = 'wss://ws-ap1.pusher.com/app/barBaz?client=api-clients%2Fpusher+%28https%3A%2F%2Fphp-api-clients.org%2Fclients%2Fpusher%29&protocol=7&version=' . ApiSettings::getVersion();
49+
$expectedUrl = 'wss://ws-ap1.pusher.com/app/barBaz?' .
50+
'client=api-clients%2Fpusher+%28https%3A%2F%2Fphp-api-clients.org%2Fclients%2Fpusher%29&' .
51+
'protocol=7&version=' . ApiSettings::getVersion();
4852

49-
self::assertSame($expectedUrl, ApiSettings::createUrl('barBaz','ap1'));
53+
self::assertSame($expectedUrl, ApiSettings::createUrl('barBaz', 'ap1'));
5054
}
5155
}

0 commit comments

Comments
 (0)