← All changes
|
jetpack_vendor/automattic/jetpack-connection/src/class-secrets.php
+2
-0
12.5.2
→
16.3-beta
View file →
| @@ -92,8 +92,9 @@ | ||
| 92 | 92 | * |
| 93 | 93 | * @param String $action The action name. |
| 94 | 94 | * @param Integer $user_id The user identifier. |
| 95 | 95 | * @return string|array an array of secrets or an error string. |
| 96 | + * @phan-return string|array{secret_1:string,secret_2:string,exp:int} | |
| 96 | 97 | */ |
| 97 | 98 | public function get( $action, $user_id ) { |
| 98 | 99 | $secret_name = 'jetpack_' . $action . '_' . $user_id; |
| 99 | 100 | $secrets = Jetpack_Options::get_raw_option( |
| @@ -157,8 +158,9 @@ | ||
| 157 | 158 | * @param \WP_User $user The user object. |
| 158 | 159 | */ |
| 159 | 160 | do_action( 'jetpack_verify_secrets_begin', $action, $user ); |
| 160 | 161 | |
| 162 | + /** Closure to run the 'fail' action and return an error. */ | |
| 161 | 163 | $return_error = function ( WP_Error $error ) use ( $action, $user ) { |
| 162 | 164 | /** |
| 163 | 165 | * Verifying of the previously generated secret has failed. |
| 164 | 166 | * |