Plugin: backport PHP 8 syntax to PHP 7.4 (hc-eff)
The central history server work introduced four PHP 8.0+ syntax sites in the plugin codebase. The main plugin file's "Requires PHP: 7.4" header was already there; the code had silently drifted past that bound. - includes/class-att-hc-session.php:244 — str_starts_with($host, 'www.') → substr($host, 0, 4) === 'www.'. - includes/class-att-hc-api.php:52 — self::request(…, requires_auth: false) → positional false. Same default semantics, same callee signature. - includes/admin-page.php:165 and class-att-hc-session.php:126 — list_healthchecks(…, include_steps: …, limit: …) → positional. Same values, no semantic change. Verified by linting all 16 plugin files against PHP 7.4.33 — no syntax errors, no residual PHP 8+ patterns (str_starts_with/contains/ends_with, nullsafe, enum, readonly, mixed/never, constructor promotion, match). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -162,7 +162,7 @@ function att_hc_render_start_panel(): void {
|
||||
$recent = [];
|
||||
$lookup_err = null;
|
||||
try {
|
||||
$resp = ATT_HC_Api::list_healthchecks($site_key, include_steps: false, limit: 20);
|
||||
$resp = ATT_HC_Api::list_healthchecks($site_key, false, 20);
|
||||
foreach ($resp['healthchecks'] ?? [] as $hc) {
|
||||
if (empty($hc['finished_at'])) $incomplete[] = $hc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user