Apply automated PHP8 safety transforms

Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/89922108-1604-44ae-949d-358d32b9d70a

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-04-23 14:01:37 +00:00 committed by GitHub
parent aca850b6cd
commit e44519c030
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
465 changed files with 1716 additions and 1716 deletions

View file

@ -109,7 +109,7 @@ class TeamSpeak3_Adapter_Blacklist extends TeamSpeak3_Adapter_Abstract
$repl = $this->getTransport()->read(1);
$this->getTransport()->disconnect();
if(!count($repl))
if(!count((array)$repl))
{
return FALSE;
}

View file

@ -141,7 +141,7 @@ class TeamSpeak3_Adapter_FileTransfer extends TeamSpeak3_Adapter_Abstract
$size = intval($size);
$pack = 4096;
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferDownloadStarted", $ftkey, count($buff), $size);
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferDownloadStarted", $ftkey, count((array)$buff), $size);
for($seek = 0;$seek < $size;)
{
@ -152,16 +152,16 @@ class TeamSpeak3_Adapter_FileTransfer extends TeamSpeak3_Adapter_Abstract
$buff->append($data);
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferDownloadProgress", $ftkey, count($buff), $size);
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferDownloadProgress", $ftkey, count((array)$buff), $size);
}
$this->getProfiler()->stop();
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferDownloadFinished", $ftkey, count($buff), $size);
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferDownloadFinished", $ftkey, count((array)$buff), $size);
if(strlen($buff) != $size)
{
throw new TeamSpeak3_Adapter_FileTransfer_Exception("incomplete file download (" . count($buff) . " of " . $size . " bytes)");
throw new TeamSpeak3_Adapter_FileTransfer_Exception("incomplete file download (" . count((array)$buff) . " of " . $size . " bytes)");
}
return $buff;

View file

@ -176,7 +176,7 @@ class TeamSpeak3_Adapter_ServerQuery extends TeamSpeak3_Adapter_Abstract
$args = array();
$cells = array();
foreach($params as $ident => $value)
foreach ((array)$params as $ident => $value)
{
$ident = is_numeric($ident) ? "" : strtolower($ident) . TeamSpeak3::SEPARATOR_PAIR;
@ -184,7 +184,7 @@ class TeamSpeak3_Adapter_ServerQuery extends TeamSpeak3_Adapter_Abstract
{
$value = array_values($value);
for($i = 0; $i < count($value); $i++)
for($i = 0; $i < count((array)$value); $i++)
{
if($value[$i] === null) continue;
elseif($value[$i] === FALSE) $value[$i] = 0x00;
@ -207,8 +207,8 @@ class TeamSpeak3_Adapter_ServerQuery extends TeamSpeak3_Adapter_Abstract
foreach(array_keys($cells) as $ident) $cells[$ident] = implode(TeamSpeak3::SEPARATOR_CELL, $cells[$ident]);
if(count($args)) $cmd .= " " . implode(TeamSpeak3::SEPARATOR_CELL, $args);
if(count($cells)) $cmd .= " " . implode(TeamSpeak3::SEPARATOR_LIST, $cells);
if(count((array)$args)) $cmd .= " " . implode(TeamSpeak3::SEPARATOR_CELL, $args);
if(count((array)$cells)) $cmd .= " " . implode(TeamSpeak3::SEPARATOR_LIST, $cells);
return trim($cmd);
}

View file

@ -112,7 +112,7 @@ class TeamSpeak3_Adapter_ServerQuery_Reply
if(!func_num_args())
{
for($i = 0; $i < count($list); $i++) $list[$i]->unescape();
for($i = 0; $i < count((array)$list); $i++) $list[$i]->unescape();
}
return $list;
@ -133,7 +133,7 @@ class TeamSpeak3_Adapter_ServerQuery_Reply
if(!func_num_args())
{
for($i = 0; $i < count($pairs); $i++) $pairs[$i]->unescape();
for($i = 0; $i < count((array)$pairs); $i++) $pairs[$i]->unescape();
}
$table[] = $pairs;
@ -152,11 +152,11 @@ class TeamSpeak3_Adapter_ServerQuery_Reply
$array = array();
$table = $this->toTable(1);
for($i = 0; $i < count($table); $i++)
for($i = 0; $i < count((array)$table); $i++)
{
foreach($table[$i] as $pair)
foreach ((array)$table[$i] as $pair)
{
if(!count($pair))
if(!count((array)$pair))
{
continue;
}
@ -189,7 +189,7 @@ class TeamSpeak3_Adapter_ServerQuery_Reply
$nodes = (func_num_args() > 1) ? $this->toArray(1) : $this->toArray();
$array = array();
foreach($nodes as $node)
foreach ((array)$nodes as $node)
{
if(isset($node[$ident]))
{
@ -213,7 +213,7 @@ class TeamSpeak3_Adapter_ServerQuery_Reply
{
$array = func_num_args() ? $this->toArray(1) : $this->toArray();
if(count($array) == 1)
if(count((array)$array) == 1)
{
return array_shift($array);
}
@ -230,7 +230,7 @@ class TeamSpeak3_Adapter_ServerQuery_Reply
{
$array = (func_num_args() > 1) ? $this->toArray(1) : $this->toArray();
for($i = 0; $i < count($array); $i++)
for($i = 0; $i < count((array)$array); $i++)
{
$array[$i] = (object) $array[$i];
}
@ -325,7 +325,7 @@ class TeamSpeak3_Adapter_ServerQuery_Reply
*/
protected function fetchReply($rpl)
{
foreach($rpl as $key => $val)
foreach ((array)$rpl as $key => $val)
{
if($val->startsWith(TeamSpeak3::TS3_MOTD_PREFIX) || $val->startsWith(TeamSpeak3::TEA_MOTD_PREFIX) || (defined("CUSTOM_MOTD_PREFIX") && $val->startsWith(CUSTOM_MOTD_PREFIX)))
{