fix(compat): preserve PHP 8.0 support without changing control guards
Tests / test (push) Successful in 59s
Tests / test (push) Successful in 59s
Replace trait constants and array_is_list usage with equivalent PHP 8.0 constructs. Add strict list/expiry regressions and make isolated reflection tests PHP 8.0 compatible. No control activation, threshold or configuration change.
This commit is contained in:
@@ -18,7 +18,7 @@ final class NetzfahrplanV4Rueckmeldung
|
||||
|
||||
private static function ordered(array $v): array
|
||||
{
|
||||
if (!array_is_list($v)) ksort($v, SORT_STRING);
|
||||
if (array_keys($v) !== array_keys(array_values($v))) ksort($v, SORT_STRING);
|
||||
foreach ($v as &$x) if (is_array($x)) $x=self::ordered($x);
|
||||
unset($x);return $v;
|
||||
}
|
||||
@@ -40,7 +40,7 @@ final class NetzfahrplanV4Rueckmeldung
|
||||
}
|
||||
$c['idleToleranceW']=self::number($c['idleToleranceW'],0,100);
|
||||
$c['trackingToleranceW']=self::number($c['trackingToleranceW'],0,500);
|
||||
if (!is_array($c['sources']) || !array_is_list($c['sources']) || count($c['sources'])<2 || count($c['sources'])>40) throw new InvalidArgumentException('feedback_sources_invalid');
|
||||
if (!is_array($c['sources']) || array_keys($c['sources']) !== array_keys(array_values($c['sources'])) || count($c['sources'])<2 || count($c['sources'])>40) throw new InvalidArgumentException('feedback_sources_invalid');
|
||||
$ids=[];$names=[];$roles=[];
|
||||
foreach ($c['sources'] as &$s) {
|
||||
$fields=['key','role','variableId','parentId','ident','factorToW'];
|
||||
|
||||
Reference in New Issue
Block a user