diff --git a/inc/class-inputfactory.php b/inc/class-inputfactory.php index b159ce11..6edca37c 100644 --- a/inc/class-inputfactory.php +++ b/inc/class-inputfactory.php @@ -122,7 +122,7 @@ private static function get_attributes( array $params ): string { } /** - * @psalm-param HelpArgs $args + * @psalm-param HelpArgs&mixed[] $args */ private static function render_help( array $args ): void { if ( ! empty( $args['help'] ) ) { diff --git a/inc/class-plugin.php b/inc/class-plugin.php index 63718118..940bcaad 100644 --- a/inc/class-plugin.php +++ b/inc/class-plugin.php @@ -32,6 +32,7 @@ public function init(): void { /** * @psalm-param array $providers * @psalm-return array + * @psalm-suppress MoreSpecificReturnType, LessSpecificReturnStatement */ public function two_factor_providers( array $providers ): array { $providers[ TwoFactor_Provider_WebAuthn::class ] = __DIR__ . '/class-twofactor-provider-webauthn.php'; diff --git a/inc/class-webauthn-provider.php b/inc/class-webauthn-provider.php index e941b02a..246c2bb5 100644 --- a/inc/class-webauthn-provider.php +++ b/inc/class-webauthn-provider.php @@ -54,7 +54,6 @@ public function get_label() { * @return void */ public function authentication_page( $user ) { - /** @psalm-suppress UnresolvableInclude */ require_once ABSPATH . '/wp-admin/includes/template.php'; if ( ! is_ssl() ) { diff --git a/stubs/wordpress.stubs.php b/stubs/wordpress.stubs.php index 859421c3..e0095e52 100644 --- a/stubs/wordpress.stubs.php +++ b/stubs/wordpress.stubs.php @@ -77,4 +77,15 @@ function wp_send_json_error( $data = null, $status_code = null, $options = 0 ) { * @psalm-return never-return */ function wp_send_json( $response, $status_code = null, $options = 0 ) {} + + /** + * @param string $id + * @param string $title + * @param callable $callback + * @param string $page + * @param string $section + * @psalm-param array{class?: string, label_for?: string, ...} $args + * @return void + */ + function add_settings_field( $id, $title, $callback, $page, $section = 'default', $args = array() ) {} }