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

@ -104,7 +104,7 @@ abstract class LuminousFormatter {
$num_lines = 1;
$num_open = 0;
foreach($line_split as $l) {
foreach ((array)$line_split as $l) {
$l0 = $l[0];
if ($l0 === '<') {

View file

@ -90,7 +90,7 @@ class LuminousHTMLTemplates {
$template = self::_strip_template_whitespace($template);
}
foreach($variables as $search => $replace) {
foreach ((array)$variables as $search => $replace) {
$template = str_replace("{" . $search . "}", $replace, $template);
}
return $template;
@ -138,7 +138,7 @@ class LuminousFormatterHTML extends LuminousFormatter {
private function lines_numberless($src) {
$lines = array();
$lines_original = explode("\n", $src);
foreach($lines_original as $line) {
foreach ((array)$lines_original as $line) {
$l = $line;
$num = $this->wrap_line($l, $this->wrap_length);
// strip the newline if we're going to join it. Seems the easiest way to
@ -212,7 +212,7 @@ class LuminousFormatterHTML extends LuminousFormatter {
preg_match_all("/<\/([^\s>]*).*?>/", $matches[0], $close_tags,
PREG_SET_ORDER);
if (count($open_tags) != count($close_tags))
if (count((array)$open_tags) != count((array)$close_tags))
return $matches[0];
if (isset($open_tags[0])
&& trim($open_tags[0][1]) !== trim($close_tags[0][1])

View file

@ -116,7 +116,7 @@ EOF;
if ($this->wrap_length > 0) {
$str = '';
foreach($lines as $i=>$l) {
foreach ((array)$lines as $i=>$l) {
$this->wrap_line($l, $this->wrap_length);
$str .= $l;
}
@ -132,7 +132,7 @@ EOF;
return "{\\\textbackslash}";
return "\\\" . $matches[0];');
foreach($str_ as $s_) {
foreach ((array)$str_ as $s_) {
if ($s_[0] === '<') {
$s_ = preg_replace('%</[^>]+>%', '}', $s_);
$s_ = preg_replace_callback('%<([^>]+)>%', $f1
@ -167,7 +167,7 @@ EOF;
// NOTE: p being a reference is probably going to necessitate a lot of
// copying to pass through all these preg_* and str* calls.
// consider rewriting.
foreach($pieces as $k=>&$p) {
foreach ((array)$pieces as $k=>&$p) {
if (preg_match('/^\\\lms/', $p))
$stack[] = "" . $p;
elseif(preg_match('/^(\\\\\\\\)*\}/', $p)) {
@ -178,7 +178,7 @@ EOF;
elseif(strpos($p, "\n") !== false) {
$before = "";
$after = "";
foreach($stack as $st_) {
foreach ((array)$stack as $st_) {
$before .= $st_;
$after .= '}';
}