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:
@@ -12,8 +12,16 @@ require_once __DIR__ . '/NetzfahrplanV4Regeltest.php';
|
||||
/** Locally approved, time-boxed operation of validated V4 shadow plans on a test plant. */
|
||||
trait ManagerNetzfahrplanV4AktivtestTrait
|
||||
{
|
||||
private const V4_AKTIVTEST_DAUER_SEKUNDEN = 172800;
|
||||
private const V4_AKTIVTEST_WATCHDOG_VERZICHT = 'explicit_test_plant_watchdog_waiver';
|
||||
// Trait constants require PHP 8.2; keep these fixed values compatible with PHP 8.0.
|
||||
private static function v4AktivtestDauerSekunden(): int
|
||||
{
|
||||
return 172800;
|
||||
}
|
||||
|
||||
private static function v4AktivtestWatchdogVerzicht(): string
|
||||
{
|
||||
return 'explicit_test_plant_watchdog_waiver';
|
||||
}
|
||||
|
||||
private function registriereV4ManagerAktivtest(): void
|
||||
{
|
||||
@@ -78,12 +86,12 @@ trait ManagerNetzfahrplanV4AktivtestTrait
|
||||
$until = $this->ReadAttributeInteger('NetzfahrplanV4AktivtestEnde');
|
||||
if ($start === 0 && $until === 0) {
|
||||
$start = $now;
|
||||
$until = $now + self::V4_AKTIVTEST_DAUER_SEKUNDEN;
|
||||
$until = $now + self::v4AktivtestDauerSekunden();
|
||||
$this->WriteAttributeInteger('NetzfahrplanV4AktivtestBeginn', $start);
|
||||
$this->WriteAttributeInteger('NetzfahrplanV4AktivtestEnde', $until);
|
||||
}
|
||||
if ($start <= 0 || $until <= $now
|
||||
|| $until - $start > self::V4_AKTIVTEST_DAUER_SEKUNDEN) {
|
||||
|| $until - $start > self::v4AktivtestDauerSekunden()) {
|
||||
throw new RuntimeException('Die einmalige 48-Stunden-Aktivtestfreigabe ist abgelaufen.');
|
||||
}
|
||||
|
||||
@@ -103,7 +111,7 @@ trait ManagerNetzfahrplanV4AktivtestTrait
|
||||
'maxChargeW' => $maxChargeW,
|
||||
'maxDischargeW' => $maxDischargeW,
|
||||
'watchdogWaived' => true,
|
||||
'actuatorWatchdogEvidenceId' => self::V4_AKTIVTEST_WATCHDOG_VERZICHT,
|
||||
'actuatorWatchdogEvidenceId' => self::v4AktivtestWatchdogVerzicht(),
|
||||
'feedbackConfigHash' => $operation['localFeedback'][$asset['ID']]['configHash'] ?? '',
|
||||
'gridLimits' => NetzfahrplanV4Planpruefung::kontext($operation)['limits'],
|
||||
'sequence' => 1,
|
||||
@@ -206,7 +214,7 @@ trait ManagerNetzfahrplanV4AktivtestTrait
|
||||
'maxChargeW' => $session['maxChargeW'],
|
||||
'maxDischargeW' => $session['maxDischargeW'],
|
||||
'accountingEvidenceId' => $quality['accountingEvidenceId'] ?? null,
|
||||
'actuatorWatchdogEvidenceId' => self::V4_AKTIVTEST_WATCHDOG_VERZICHT,
|
||||
'actuatorWatchdogEvidenceId' => self::v4AktivtestWatchdogVerzicht(),
|
||||
'acceptEstimatedPeak' => true,
|
||||
'controlContext' => $plan['controlContext'] ?? null,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user