generated from Potter/Http-Server-Aware
init
This commit is contained in:
@@ -8,36 +8,36 @@ use \React\Socket\SocketServer;
|
|||||||
|
|
||||||
trait SocketServerAwareTrait
|
trait SocketServerAwareTrait
|
||||||
{
|
{
|
||||||
private const string HTTP_SERVER = 'socketServer';
|
private const string SOCKET_SERVER = 'socketServer';
|
||||||
|
|
||||||
final public function getSocketServer(): SocketServer
|
final public function getSocketServer(): SocketServer
|
||||||
{
|
{
|
||||||
return $this->get(self::HTTP_SERVER);
|
return $this->get(self::SOCKET_SERVER);
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function hasSocketServer(): bool
|
final public function hasSocketServer(): bool
|
||||||
{
|
{
|
||||||
return $this->has(self::HTTP_SERVER);
|
return $this->has(self::SOCKET_SERVER);
|
||||||
}
|
}
|
||||||
|
|
||||||
final protected function setSocketServer(SocketServer $socketServer): SocketServer
|
final protected function setSocketServer(SocketServer $socketServer): SocketServer
|
||||||
{
|
{
|
||||||
return $this->set(self::HTTP_SERVER, $socketServer);
|
return $this->set(self::SOCKET_SERVER, $socketServer);
|
||||||
}
|
}
|
||||||
|
|
||||||
final protected function unsetSocketServer(): null
|
final protected function unsetSocketServer(): null
|
||||||
{
|
{
|
||||||
return $this->unset(self::HTTP_SERVER);
|
return $this->unset(self::SOCKET_SERVER);
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function withSocketServer(SocketServer $socketServer): static
|
final public function withSocketServer(SocketServer $socketServer): static
|
||||||
{
|
{
|
||||||
return $this->with(self::HTTP_SERVER, $socketServer);
|
return $this->with(self::SOCKET_SERVER, $socketServer);
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function withoutSocketServer(): static
|
final public function withoutSocketServer(): static
|
||||||
{
|
{
|
||||||
return $this->without(self::HTTP_SERVER);
|
return $this->without(self::SOCKET_SERVER);
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract public function get(string $key): mixed;
|
abstract public function get(string $key): mixed;
|
||||||
|
|||||||
Reference in New Issue
Block a user