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

@ -61,9 +61,9 @@ class Normalize extends Base
$result = array_merge($result, $this->check('general', $result));
// Do player information
if (isset($result['players']) && count($result['players']) > 0) {
if (isset($result['players']) && count((array)$result['players']) > 0) {
// Iterate
foreach ($result['players'] as $key => $player) {
foreach ((array)$result['players'] as $key => $player) {
$result['players'][$key] = array_merge($player, $this->check('player', $player));
}
} else {
@ -71,9 +71,9 @@ class Normalize extends Base
}
// Do team information
if (isset($result['teams']) && count($result['teams']) > 0) {
if (isset($result['teams']) && count((array)$result['teams']) > 0) {
// Iterate
foreach ($result['teams'] as $key => $team) {
foreach ((array)$result['teams'] as $key => $team) {
$result['teams'][$key] = array_merge($team, $this->check('team', $team));
}
} else {
@ -111,15 +111,15 @@ class Normalize extends Base
if (is_array($raw)) {
// Iterate over the raw property we want to use
foreach ($raw as $check) {
if (array_key_exists($check, $data)) {
foreach ((array)$raw as $check) {
if (array_key_exists($check, (array)$data)) {
$value = $data[$check];
break;
}
}
} else {
// String
if (array_key_exists($raw, $data)) {
if (array_key_exists($raw, (array)$data)) {
$value = $data[$raw];
}
}

View file

@ -59,7 +59,7 @@ class Secondstohuman extends Base
public function __construct(array $options = [])
{
// Check for passed keys
if (!array_key_exists(self::OPTION_TIMEKEYS, $options)) {
if (!array_key_exists(self::OPTION_TIMEKEYS, (array)$options)) {
// Use default
$options[self::OPTION_TIMEKEYS] = $this->timeKeysDefault;
} else {
@ -98,7 +98,7 @@ class Secondstohuman extends Base
protected function iterate(array &$result)
{
// Iterate over the results
foreach ($result as $key => $value) {
foreach ((array)$result as $key => $value) {
// Offload to itself if we have another array
if (is_array($value)) {
// Iterate and update the result