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

@ -96,7 +96,7 @@ class LuminousFilters {
$start = "$lead<DOCTAG>$tag_char$tag</DOCTAG><DOCPROPERTY>";
$j = 0;
$c = count($l);
$c = count((array)$l);
for($i=0; $j<$len && $i<$c; $i++)
{
$s = $l[$i];
@ -268,7 +268,7 @@ class LuminousFilters {
* This is a stream filter.
*/
static function oo_stream_filter($tokens) {
$c = count($tokens);
$c = count((array)$tokens);
for($i=0; $i<$c; $i++) {
if ($tokens[$i][0] !== 'IDENT') continue;
if ($i > 0) {

View file

@ -473,7 +473,7 @@ class Scanner {
$matches = null;
$name = null;
$m;
foreach($patterns as $name_=>$p) {
foreach ((array)$patterns as $name_=>$p) {
$index = $this->ss->match($p, $this->index, $m);
if ($index === false) continue;
if ($next === -1 || $index < $next) {
@ -500,7 +500,7 @@ class Scanner {
function get_next($patterns) {
$next = -1;
$matches = null;
foreach($patterns as $p) {
foreach ((array)$patterns as $p) {
$m;
$index = $this->ss->match($p, $this->index, $m);
if ($index === false) continue;
@ -524,7 +524,7 @@ class Scanner {
function get_next_strpos($patterns) {
$next = -1;
$match = null;
foreach($patterns as $p) {
foreach ((array)$patterns as $p) {
$index = strpos($this->src, $p, $this->index);
if ($index === false) continue;
if ($next === -1 || $index < $next) {
@ -802,7 +802,7 @@ class LuminousScanner extends Scanner {
* @internal
*/
protected function rule_mapper_filter($tokens) {
foreach($tokens as &$t) {
foreach ((array)$tokens as &$t) {
if (array_key_exists($t[0], $this->rule_tag_map))
$t[0] = $this->rule_tag_map[$t[0]];
}
@ -884,7 +884,7 @@ class LuminousScanner extends Scanner {
*/
public function remove_filter($name) {
foreach($this->filters as $token=>$filters) {
foreach($filters as $k=>$f) {
foreach ((array)$filters as $k=>$f) {
if ($f[0] === $name) unset($this->filters[$token][$k]);
}
}
@ -1057,7 +1057,7 @@ class LuminousScanner extends Scanner {
*/
function add_identifier_mapping($name, $matches) {
$array = array();
foreach($matches as $m) {
foreach ((array)$matches as $m) {
if (!$this->case_sensitive) $m = strtolower($m);
$array[$m] = true;
}
@ -1825,7 +1825,7 @@ class LuminousStatefulScanner extends LuminousSimpleScanner {
*/
protected function collapse_token_tree($node) {
$text = '';
foreach($node['children'] as $c) {
foreach ((array)$node['children'] as $c) {
if (is_string($c)) $text .= LuminousUtils::escape_string($c);
else $text .= $this->collapse_token_tree($c);
}

View file

@ -71,7 +71,7 @@ class LuminousStringSearch
$r = $matches_[0][1];
// strip the offsets from the match_groups
foreach($matches_ as $i=>&$v)
foreach ((array)$matches_ as $i=>&$v)
$v = $v[0];
$this->cache[$search] = array($r, $matches_);