Skip to content

Commit

Permalink
Merge pull request #40 from mateusan/master
Browse files Browse the repository at this point in the history
fix: Type: Error; Message: Typed property Bloatless\WebSocket\Server::$timers must not be accessed before initialization
  • Loading branch information
nekudo authored Dec 28, 2021
2 parents 3a1cecc + c31e172 commit cc7d6d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public function __construct(
$this->host = $host;
$this->port = $port;
$this->ipcSocketPath = $ipcSocketPath;
$this->timers = new TimerCollection();
}

/**
Expand All @@ -137,7 +138,6 @@ public function run(): void
ob_implicit_flush();
$this->createSocket($this->host, $this->port);
$this->openIPCSocket($this->ipcSocketPath);
$this->timers = new TimerCollection();
$this->log('Server created');

while (true) {
Expand Down

1 comment on commit cc7d6d8

@haugli92
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to solve this problem:

Type: Error
Message: Typed property Bloatless\WebSocket\Server::$timers must not be accessed before initialization
Filename: /vendor/bloatless/php-websocket/src/Server.php
Line Number: 507

Please sign in to comment.