Skip to content
This repository was archived by the owner on Jan 14, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
class Client
{
const HEROKU_PLATFORM = 'herokuapp.com';

const GLITCH_PLATFORM = 'glitch.me';

/** @var Socket $client */
private $client;

/** @var string $host */
private $host;

/** @var string $namespace */
private $namespace;

Expand All @@ -39,17 +39,16 @@ public function initialize(
string $name,
string $token = 'gingdev',
string $platform = self::HEROKU_PLATFORM
)
{
) {
$this->host = sprintf("https://%s.%s/api", $name, $platform);
$this->client->setHeader('Authorization', 'Bearer ' . $token);
$this->namespace = '/';
return $this;
}

/**
* Change namespace
*
*
* @param string $namespace
* @return $this
*/
Expand All @@ -58,7 +57,7 @@ public function of(string $namespace)
$this->namespace = $namespace;
return $this;
}

/**
* Emit data to socket server
*
Expand Down
4 changes: 2 additions & 2 deletions tests/SocketTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function testSendMessage(): void
'message' => 'Test message'
]);
$client->close();

$this->assertTrue($test);
}
public function testSendNamespace(): void
Expand All @@ -29,7 +29,7 @@ public function testSendNamespace(): void
'message' => 'Test message'
]);
$client->close();

$this->assertTrue($test);
}
}