@@ -186,7 +186,7 @@ |
||
| 186 | 186 | * Sign a string with a given key and algorithm. |
| 187 | 187 | * |
| 188 | 188 | * @param string $msg The message to sign. |
| 189 | - * @param string|resource $key The secret key. |
|
| 189 | + * @param string $key The secret key. |
|
| 190 | 190 | * @param string $alg The signing algorithm. |
| 191 | 191 | * Supported algorithms are 'HS256', 'HS384', 'HS512' and 'RS256'. |
| 192 | 192 | * |
@@ -149,7 +149,7 @@ |
||
| 149 | 149 | /** |
| 150 | 150 | * Get the token stored in the auth cookie. |
| 151 | 151 | * |
| 152 | - * @return ?string |
|
| 152 | + * @return string |
|
| 153 | 153 | */ |
| 154 | 154 | private function token_from_cookie() { |
| 155 | 155 | if ( isset( $_COOKIE[ self::JWT_AUTH_TOKEN_COOKIE_NAME ] ) ) { |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * |
| 92 | 92 | * @param $function array A function structure to apply to the query |
| 93 | 93 | * |
| 94 | - * @return void |
|
| 94 | + * @return Jetpack_WPES_Query_Builder |
|
| 95 | 95 | */ |
| 96 | 96 | public function add_weighting_function( $function ) { |
| 97 | 97 | // check for danger. |
@@ -114,10 +114,10 @@ discard block |
||
| 114 | 114 | * |
| 115 | 115 | * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html |
| 116 | 116 | * |
| 117 | - * @param $function string name of the function |
|
| 117 | + * @param string $function string name of the function |
|
| 118 | 118 | * @param $params array functions parameters |
| 119 | 119 | * |
| 120 | - * @return void |
|
| 120 | + * @return Jetpack_WPES_Query_Builder |
|
| 121 | 121 | */ |
| 122 | 122 | public function add_function( $function, $params ) { |
| 123 | 123 | $this->functions[ $function ][] = $params; |
@@ -133,10 +133,10 @@ discard block |
||
| 133 | 133 | * |
| 134 | 134 | * @see https://www.elastic.co/guide/en/elasticsearch/guide/current/decay-functions.html |
| 135 | 135 | * |
| 136 | - * @param $function string name of the decay function - linear, exp, or gauss |
|
| 136 | + * @param string $function string name of the decay function - linear, exp, or gauss |
|
| 137 | 137 | * @param $params array The decay functions parameters, passed to ES directly |
| 138 | 138 | * |
| 139 | - * @return void |
|
| 139 | + * @return Jetpack_WPES_Query_Builder |
|
| 140 | 140 | */ |
| 141 | 141 | public function add_decay( $function, $params ) { |
| 142 | 142 | $this->decays[ $function ][] = $params; |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * |
| 152 | 152 | * @param $mode string name of how to score |
| 153 | 153 | * |
| 154 | - * @return void |
|
| 154 | + * @return Jetpack_WPES_Query_Builder |
|
| 155 | 155 | */ |
| 156 | 156 | public function add_score_mode_to_functions( $mode='multiply' ) { |
| 157 | 157 | $this->functions_score_mode = $mode; |
@@ -177,6 +177,9 @@ discard block |
||
| 177 | 177 | return $this; |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | + /** |
|
| 181 | + * @param string $aggs_name |
|
| 182 | + */ |
|
| 180 | 183 | public function add_aggs( $aggs_name, $aggs ) { |
| 181 | 184 | $this->aggs_query = true; |
| 182 | 185 | $this->aggs[$aggs_name] = $aggs; |
@@ -22,6 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * Scan every PHP in the root |
| 25 | + * @param string $root |
|
| 25 | 26 | */ |
| 26 | 27 | public function scan( $root, $exclude = array() ) { |
| 27 | 28 | if ( is_dir( $root ) ) { |
@@ -33,6 +34,9 @@ discard block |
||
| 33 | 34 | } |
| 34 | 35 | } |
| 35 | 36 | |
| 37 | + /** |
|
| 38 | + * @param string $root |
|
| 39 | + */ |
|
| 36 | 40 | public function scan_dir( $root, $exclude = array() ) { |
| 37 | 41 | |
| 38 | 42 | if ( is_null( $exclude ) || ! is_array( $exclude ) ) { |
@@ -124,7 +124,7 @@ |
||
| 124 | 124 | * @param int $cutoff_timestamp All nonces added before this timestamp will be removed. |
| 125 | 125 | * @param int $time_limit How long the cleanup can run (in seconds). |
| 126 | 126 | * |
| 127 | - * @return true |
|
| 127 | + * @return boolean |
|
| 128 | 128 | */ |
| 129 | 129 | public function clean_all( $cutoff_timestamp = PHP_INT_MAX, $time_limit = 20 ) { |
| 130 | 130 | // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed |
@@ -229,7 +229,7 @@ |
||
| 229 | 229 | * |
| 230 | 230 | * @param string $notify_moderator The value of the moderation_notify option OR if the comment is awaiting moderation. |
| 231 | 231 | * @param int $comment_id Comment ID. |
| 232 | - * @return boolean Returns false to shortcircuit the execution of wp_notify_moderator |
|
| 232 | + * @return string|false Returns false to shortcircuit the execution of wp_notify_moderator |
|
| 233 | 233 | */ |
| 234 | 234 | function jetpack_notify_moderator( $notify_moderator, $comment_id ) { |
| 235 | 235 | /* |
@@ -168,7 +168,7 @@ |
||
| 168 | 168 | /** |
| 169 | 169 | * Checks to see whether or not the root package is the one that required the autoloader. |
| 170 | 170 | * |
| 171 | - * @return bool |
|
| 171 | + * @return null|boolean |
|
| 172 | 172 | */ |
| 173 | 173 | private function isRequiredByRoot() { |
| 174 | 174 | $package = $this->composer->getPackage(); |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | * @param array $post_types - other post types. |
| 194 | 194 | * |
| 195 | 195 | * @see hook 'rest_api_allowed_post_types' |
| 196 | - * @return array |
|
| 196 | + * @return string[] |
|
| 197 | 197 | */ |
| 198 | 198 | public function allow_rest_api_types( $post_types ) { |
| 199 | 199 | $post_types[] = self::$post_type_plan; |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | * (because it requires a plan upgrade or Stripe connection), and the |
| 255 | 255 | * button is a child of a Premium Content block. |
| 256 | 256 | * |
| 257 | - * @param WP_Block $block Recurring Payments block instance. |
|
| 257 | + * @param WP_Block|null $block Recurring Payments block instance. |
|
| 258 | 258 | * |
| 259 | 259 | * @return boolean |
| 260 | 260 | */ |
@@ -136,6 +136,10 @@ discard block |
||
| 136 | 136 | ); |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | + /** |
|
| 140 | + * @param string $service_name |
|
| 141 | + * @param string $for |
|
| 142 | + */ |
|
| 139 | 143 | static function refresh_url( $service_name, $for ) { |
| 140 | 144 | return add_query_arg( |
| 141 | 145 | array( |
@@ -150,6 +154,10 @@ discard block |
||
| 150 | 154 | ); |
| 151 | 155 | } |
| 152 | 156 | |
| 157 | + /** |
|
| 158 | + * @param string $service_name |
|
| 159 | + * @param string $id |
|
| 160 | + */ |
|
| 153 | 161 | static function disconnect_url( $service_name, $id ) { |
| 154 | 162 | return add_query_arg( |
| 155 | 163 | array( |