Skip to content

Commit

Permalink
Fix PHPStan 2.x errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Jan 3, 2025
1 parent 2e82e87 commit f16af7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/server/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use raklib\utils\ExceptionTraceCleaner;
use raklib\utils\InternetAddress;
use function asort;
use function assert;
use function bin2hex;
use function count;
use function get_class;
Expand Down Expand Up @@ -214,6 +215,9 @@ private function receivePacket() : bool{
if($buffer === null){
return false; //no data
}
assert($addressIp !== null, "Can't be null if we got a buffer");
assert($addressPort !== null, "Can't be null if we got a buffer");

$len = strlen($buffer);

$this->receiveBytes += $len;
Expand Down
2 changes: 2 additions & 0 deletions tools/proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ function serverToClientRelay(ClientSession $client, ServerSocket $clientProxySoc
if($buffer === null || $buffer === ""){
continue;
}
assert($recvAddr !== null, "Can't be null if we got a buffer");
assert($recvPort !== null, "Can't be null if we got a buffer");
if(isset($clients[$recvAddr][$recvPort])){
$client = $clients[$recvAddr][$recvPort];
$client->setActive();
Expand Down

0 comments on commit f16af7d

Please sign in to comment.