@@ -22,7 +22,7 @@ |
||
| 22 | 22 | /** |
| 23 | 23 | * Converts GlotPress URL into a GlotPress API URL |
| 24 | 24 | * |
| 25 | - * @param sring $url URL |
|
| 25 | + * @param string $url URL |
|
| 26 | 26 | * @return sstring API URL |
| 27 | 27 | */ |
| 28 | 28 | function apize_url( $url ) { |
@@ -183,7 +183,6 @@ |
||
| 183 | 183 | /** |
| 184 | 184 | * Record an event in Tracks - this is the preferred way to record events from PHP. |
| 185 | 185 | * |
| 186 | - * @param mixed $identity username, user_id, or WP_user object |
|
| 187 | 186 | * @param string $event_name The name of the event |
| 188 | 187 | * @param array $properties Custom properties to send with the event |
| 189 | 188 | * @param int $event_timestamp_millis The time in millis since 1970-01-01 00:00:00 when the event occurred |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * record_event |
| 51 | - * @param mixed $event Event object to send to Tracks. An array will be cast to object. Required. |
|
| 51 | + * @param Jetpack_Tracks_Event $event Event object to send to Tracks. An array will be cast to object. Required. |
|
| 52 | 52 | * Properties are included directly in the pixel query string after light validation. |
| 53 | 53 | * @return mixed True on success, WP_Error on failure |
| 54 | 54 | */ |
@@ -71,6 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | 73 | * Synchronously request the pixel |
| 74 | + * @param string $pixel |
|
| 74 | 75 | */ |
| 75 | 76 | static function record_pixel( $pixel ) { |
| 76 | 77 | // Add the Request Timestamp and URL terminator just before the HTTP request. |
@@ -143,7 +143,6 @@ discard block |
||
| 143 | 143 | /** |
| 144 | 144 | * Mock a set of filters. |
| 145 | 145 | * |
| 146 | - * @param array $args Array of filters with their arguments. |
|
| 147 | 146 | * @return phpmock\Mock The mock object. |
| 148 | 147 | */ |
| 149 | 148 | protected function mock_filters( $filters = array() ) { |
@@ -153,8 +152,7 @@ discard block |
||
| 153 | 152 | /** |
| 154 | 153 | * Mock a set of constants. |
| 155 | 154 | * |
| 156 | - * @param array $args Array of sets with constants and their respective values. |
|
| 157 | - * @return phpmock\Mock The mock object. |
|
| 155 | + * @return phpmock\Mock[] The mock object. |
|
| 158 | 156 | */ |
| 159 | 157 | protected function mock_constants( $constants = array() ) { |
| 160 | 158 | $prepare_constant = function( $constant ) { |
@@ -171,7 +169,7 @@ discard block |
||
| 171 | 169 | * Mock a global function and make it return a certain value. |
| 172 | 170 | * |
| 173 | 171 | * @param string $function_name Name of the function. |
| 174 | - * @param mixed $return_value Return value of the function. |
|
| 172 | + * @param string $return_value Return value of the function. |
|
| 175 | 173 | * @return phpmock\Mock The mock object. |
| 176 | 174 | */ |
| 177 | 175 | protected function mock_function( $function_name, $return_value = null ) { |
@@ -95,6 +95,9 @@ |
||
| 95 | 95 | return (array) $upgrader->skin->get_upgrade_messages(); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | + /** |
|
| 99 | + * @param string $plugin_slug |
|
| 100 | + */ |
|
| 98 | 101 | protected static function generate_wordpress_org_plugin_download_link( $plugin_slug ) { |
| 99 | 102 | return "https://downloads.wordpress.org/plugin/$plugin_slug.latest-stable.zip"; |
| 100 | 103 | } |
@@ -115,7 +115,7 @@ |
||
| 115 | 115 | * Mock a global function and make it return a certain value. |
| 116 | 116 | * |
| 117 | 117 | * @param string $function_name Name of the function. |
| 118 | - * @param mixed $return_value Return value of the function. |
|
| 118 | + * @param integer $return_value Return value of the function. |
|
| 119 | 119 | * @return phpmock\Mock The mock object. |
| 120 | 120 | */ |
| 121 | 121 | protected function mock_function( $function_name, $return_value = null ) { |
@@ -171,6 +171,9 @@ |
||
| 171 | 171 | update_option( 'jetpack_plugin_api_action_links', $plugins_action_links ); |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | + /** |
|
| 175 | + * @param integer $checksum |
|
| 176 | + */ |
|
| 174 | 177 | public function should_send_callable( $callable_checksums, $name, $checksum ) { |
| 175 | 178 | $idc_override_callables = array( |
| 176 | 179 | 'main_network_site', |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | * Is the user the connection owner. |
| 107 | 107 | * |
| 108 | 108 | * @param Integer $user_id the user identifier. |
| 109 | - * @return Boolean is the user the connection owner? |
|
| 109 | + * @return integer is the user the connection owner? |
|
| 110 | 110 | */ |
| 111 | 111 | public function is_connection_owner( $user_id ) { |
| 112 | 112 | return $user_id; |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | * |
| 571 | 571 | * @param int|false $user_id false: Return the Blog Token. int: Return that user's User Token. |
| 572 | 572 | * @param string|false $token_key If provided, check that the token matches the provided input. |
| 573 | - * @param bool|true $suppress_errors If true, return a falsy value when the token isn't found; When false, return a descriptive WP_Error when the token isn't found. |
|
| 573 | + * @param boolean $suppress_errors If true, return a falsy value when the token isn't found; When false, return a descriptive WP_Error when the token isn't found. |
|
| 574 | 574 | * |
| 575 | 575 | * @return object|false |
| 576 | 576 | */ |
@@ -42,6 +42,9 @@ discard block |
||
| 42 | 42 | return array(); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | + /** |
|
| 46 | + * @param string[] $actions_to_count |
|
| 47 | + */ |
|
| 45 | 48 | protected function count_actions( $action_names, $actions_to_count ) { |
| 46 | 49 | return count( array_intersect( $action_names, $actions_to_count ) ); |
| 47 | 50 | } |
@@ -58,6 +61,11 @@ discard block |
||
| 58 | 61 | return false; |
| 59 | 62 | } |
| 60 | 63 | |
| 64 | + /** |
|
| 65 | + * @param string $action_name |
|
| 66 | + * @param string $id_field |
|
| 67 | + * @param string|null $where_sql |
|
| 68 | + */ |
|
| 61 | 69 | protected function enqueue_all_ids_as_action( $action_name, $table_name, $id_field, $where_sql, $max_items_to_enqueue, $state ) { |
| 62 | 70 | global $wpdb; |
| 63 | 71 | |
@@ -111,6 +119,9 @@ discard block |
||
| 111 | 119 | return $chunks_with_ends; |
| 112 | 120 | } |
| 113 | 121 | |
| 122 | + /** |
|
| 123 | + * @param string $meta_type |
|
| 124 | + */ |
|
| 114 | 125 | protected function get_metadata( $ids, $meta_type, $meta_key_whitelist ) { |
| 115 | 126 | global $wpdb; |
| 116 | 127 | $table = _get_meta_table( $meta_type ); |
@@ -131,12 +142,18 @@ discard block |
||
| 131 | 142 | ); |
| 132 | 143 | } |
| 133 | 144 | |
| 145 | + /** |
|
| 146 | + * @param string $meta_type |
|
| 147 | + */ |
|
| 134 | 148 | public function init_listeners_for_meta_type( $meta_type, $callable ) { |
| 135 | 149 | add_action( "added_{$meta_type}_meta", $callable, 10, 4 ); |
| 136 | 150 | add_action( "updated_{$meta_type}_meta", $callable, 10, 4 ); |
| 137 | 151 | add_action( "deleted_{$meta_type}_meta", $callable, 10, 4 ); |
| 138 | 152 | } |
| 139 | 153 | |
| 154 | + /** |
|
| 155 | + * @param string $meta_type |
|
| 156 | + */ |
|
| 140 | 157 | public function init_meta_whitelist_handler( $meta_type, $whitelist_handler ) { |
| 141 | 158 | add_filter( "jetpack_sync_before_enqueue_added_{$meta_type}_meta", $whitelist_handler ); |
| 142 | 159 | add_filter( "jetpack_sync_before_enqueue_updated_{$meta_type}_meta", $whitelist_handler ); |