@@ -401,6 +401,9 @@ |
||
| 401 | 401 | $this->assertEquals( $event->args[0]['title'], 'My Widget' ); |
| 402 | 402 | } |
| 403 | 403 | |
| 404 | + /** |
|
| 405 | + * @param string $slug |
|
| 406 | + */ |
|
| 404 | 407 | private function install_theme( $slug ) { |
| 405 | 408 | require_once ABSPATH . 'wp-admin/includes/theme-install.php'; |
| 406 | 409 | require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; |
@@ -69,6 +69,9 @@ discard block |
||
| 69 | 69 | $this->assertTrue( (bool) $has_action ); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | + /** |
|
| 73 | + * @param string $new_version |
|
| 74 | + */ |
|
| 72 | 75 | function new_plugin_response( $new_version ) { |
| 73 | 76 | return (object) array( |
| 74 | 77 | 'response' => array( |
@@ -131,6 +134,9 @@ discard block |
||
| 131 | 134 | $this->assertTrue( (bool) $has_action ); |
| 132 | 135 | } |
| 133 | 136 | |
| 137 | + /** |
|
| 138 | + * @param string $new_version |
|
| 139 | + */ |
|
| 134 | 140 | public function new_theme_response( $new_version ) { |
| 135 | 141 | return (object) array( |
| 136 | 142 | 'response' => array( |
@@ -312,6 +312,10 @@ |
||
| 312 | 312 | } |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | + /** |
|
| 316 | + * @param string $expected_meta_key |
|
| 317 | + * @param integer $expected_meta_value |
|
| 318 | + */ |
|
| 315 | 319 | private function assertHasObjectMetaValue( $metas, $order_item_id, $expected_meta_key, $expected_meta_value ) { |
| 316 | 320 | $has_meta_entry = false; |
| 317 | 321 | foreach( $metas as $meta ) { |
@@ -1032,6 +1032,9 @@ |
||
| 1032 | 1032 | return $return; |
| 1033 | 1033 | } |
| 1034 | 1034 | |
| 1035 | + /** |
|
| 1036 | + * @param string $slug |
|
| 1037 | + */ |
|
| 1035 | 1038 | private function ensure_synced_taxonomy( $store, $slug, $type = 'post' ) { |
| 1036 | 1039 | register_taxonomy( |
| 1037 | 1040 | $slug, |
@@ -13,6 +13,7 @@ |
||
| 13 | 13 | |
| 14 | 14 | /** |
| 15 | 15 | * Wrapper around `WP_REST_Request` constructor. Injects a `sites/$blog_id` into endpoint string for WPCOM environment |
| 16 | + * @param string $path |
|
| 16 | 17 | */ |
| 17 | 18 | function wp_rest_request( $method, $path ) { |
| 18 | 19 | if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | * |
| 104 | 104 | * @param object $attachment The attachment object. |
| 105 | 105 | * |
| 106 | - * @return false|int |
|
| 106 | + * @return boolean |
|
| 107 | 107 | */ |
| 108 | 108 | public function is_video( $attachment ) { |
| 109 | 109 | return isset( $attachment->post_mime_type ) && wp_startswith( $attachment->post_mime_type, 'video/' ); |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | * Removes the jetpack_videopress field from the response if the |
| 114 | 114 | * given attachment is not a video. |
| 115 | 115 | * |
| 116 | - * @param WP_REST_Response $response Response from the attachment endpoint. |
|
| 117 | - * @param WP_Post $attachment The original attachment object. |
|
| 116 | + * @param stdClass $response Response from the attachment endpoint. |
|
| 117 | + * @param stdClass $attachment The original attachment object. |
|
| 118 | 118 | * |
| 119 | 119 | * @return mixed |
| 120 | 120 | */ |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | * @param mixed $object Response from the attachment endpoint. |
| 147 | 147 | * @param WP_REST_Request $request Request to the attachment endpoint. |
| 148 | 148 | * |
| 149 | - * @return true |
|
| 149 | + * @return boolean |
|
| 150 | 150 | */ |
| 151 | 151 | public function get_permission_check( $object, $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
| 152 | 152 | return true; |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | * @param WP_Post $object The attachment object. |
| 161 | 161 | * @param WP_REST_Request $request Request to the attachment endpoint. |
| 162 | 162 | * |
| 163 | - * @return true |
|
| 163 | + * @return boolean |
|
| 164 | 164 | */ |
| 165 | 165 | public function update_permission_check( $value, $object, $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
| 166 | 166 | return true; |
@@ -100,7 +100,7 @@ |
||
| 100 | 100 | * |
| 101 | 101 | * @param string $class_name The name of the class to autoload. |
| 102 | 102 | * |
| 103 | - * @return bool Indicates whether or not a class file was loaded. |
|
| 103 | + * @return null|boolean Indicates whether or not a class file was loaded. |
|
| 104 | 104 | */ |
| 105 | 105 | public static function load_class( $class_name ) { |
| 106 | 106 | global $jetpack_autoloader_loader; |
@@ -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 ] ) ) { |