fix: add typed params + return types on PSA_Upgrade public methods

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
This commit is contained in:
peptiderepo
2026-04-14 19:56:40 +07:00
parent d69f637b06
commit 37aa0c83f3

View File

@@ -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;