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:
2026-06-30 09:29:22 +01:00
parent 3c6220e64b
commit 3c64dd8125
4 changed files with 5 additions and 4 deletions

View File

@@ -49,7 +49,7 @@ final class ATT_HC_Api {
/** GET / — verifies reachability + auth-free heartbeat. */
public static function ping(): array {
return self::request('GET', '/', null, requires_auth: false);
return self::request('GET', '/', null, false);
}
public static function create_healthcheck(array $payload): array {