From 37aa0c83f3b0460d0c71b3962c8c046a11aae88d Mon Sep 17 00:00:00 2001 From: peptiderepo Date: Tue, 14 Apr 2026 19:56:40 +0700 Subject: [PATCH] fix: add typed params + return types on PSA_Upgrade public methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QA caught this on d69f637 — AGENT-OPERATING-STANDARD.md §2 requires typed params and return types on every new public method. PHP 7.4+ supports both. Matches the pattern of other includes/ classes. - PSA_Upgrade::is_needed( string, string ): bool - PSA_Upgrade::maybe_run(): void Agent-Session: cowork-qa-p1-fixes-20260414 --- includes/class-psa-upgrade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/class-psa-upgrade.php b/includes/class-psa-upgrade.php index 23abe62..b1f20b4 100644 --- a/includes/class-psa-upgrade.php +++ b/includes/class-psa-upgrade.php @@ -52,7 +52,7 @@ class PSA_Upgrade { * @param string $current_version Version string of the running code. * @return bool True if an upgrade must run; false otherwise. */ - public static function is_needed( $stored_version, $current_version ) { + public static function is_needed( string $stored_version, string $current_version ): bool { return version_compare( $stored_version, $current_version, '<' ); } @@ -66,7 +66,7 @@ class PSA_Upgrade { * * @return void */ - public static function maybe_run() { + public static function maybe_run(): void { $stored = get_option( self::OPTION_NAME, self::DEFAULT_STORED_VERSION ); if ( ! self::is_needed( $stored, PSA_VERSION ) ) { return;