@@ -170,6 +170,9 @@ |
||
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | |
| 173 | + /** |
|
| 174 | + * @param string $plugin |
|
| 175 | + */ |
|
| 173 | 176 | protected function validate_plugin( $plugin ) { |
| 174 | 177 | if ( ! isset( $plugin) || empty( $plugin ) ) { |
| 175 | 178 | return new WP_Error( 'missing_plugin', __( 'You are required to specify a plugin to activate.', 'jetpack' ), 400 ); |
@@ -228,6 +228,9 @@ |
||
| 228 | 228 | ); |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | + /** |
|
| 232 | + * @param Queue $queue |
|
| 233 | + */ |
|
| 231 | 234 | protected function get_buffer( $queue, $number_of_items ) { |
| 232 | 235 | $start = time(); |
| 233 | 236 | $max_duration = 5; // this will try to get the buffer |
@@ -177,6 +177,9 @@ |
||
| 177 | 177 | $queue->add_all( $data_to_enqueue ); |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | + /** |
|
| 181 | + * @param Queue $queue |
|
| 182 | + */ |
|
| 180 | 183 | function enqueue_action( $current_filter, $args, $queue ) { |
| 181 | 184 | // don't enqueue an action during the outbound http request - this prevents recursion |
| 182 | 185 | if ( Settings::is_sending() ) { |
@@ -240,6 +240,9 @@ discard block |
||
| 240 | 240 | return true; |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | + /** |
|
| 244 | + * @param Queue_Buffer $buffer |
|
| 245 | + */ |
|
| 243 | 246 | function close( $buffer, $ids_to_remove = null ) { |
| 244 | 247 | $is_valid = $this->validate_checkout( $buffer ); |
| 245 | 248 | |
@@ -344,6 +347,9 @@ discard block |
||
| 344 | 347 | return false; |
| 345 | 348 | } |
| 346 | 349 | |
| 350 | + /** |
|
| 351 | + * @param string $checkout_id |
|
| 352 | + */ |
|
| 347 | 353 | private function set_checkout_id( $checkout_id ) { |
| 348 | 354 | global $wpdb; |
| 349 | 355 | |
@@ -70,6 +70,9 @@ discard block |
||
| 70 | 70 | return (float) get_option( self::NEXT_SYNC_TIME_OPTION_NAME . '_' . $queue_name, 0 ); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | + /** |
|
| 74 | + * @param integer $time |
|
| 75 | + */ |
|
| 73 | 76 | public function set_next_sync_time( $time, $queue_name ) { |
| 74 | 77 | return update_option( self::NEXT_SYNC_TIME_OPTION_NAME . '_' . $queue_name, $time, true ); |
| 75 | 78 | } |
@@ -100,6 +103,9 @@ discard block |
||
| 100 | 103 | return $this->do_sync_and_set_delays( $this->sync_queue ); |
| 101 | 104 | } |
| 102 | 105 | |
| 106 | + /** |
|
| 107 | + * @param Queue $queue |
|
| 108 | + */ |
|
| 103 | 109 | public function do_sync_and_set_delays( $queue ) { |
| 104 | 110 | // don't sync if importing |
| 105 | 111 | if ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) { |
@@ -357,6 +363,10 @@ discard block |
||
| 357 | 363 | } |
| 358 | 364 | |
| 359 | 365 | // in seconds |
| 366 | + |
|
| 367 | + /** |
|
| 368 | + * @param double $seconds |
|
| 369 | + */ |
|
| 360 | 370 | function set_max_dequeue_time( $seconds ) { |
| 361 | 371 | $this->max_dequeue_time = $seconds; |
| 362 | 372 | } |
@@ -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 |
@@ -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 ) { |
@@ -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 | */ |
@@ -99,6 +99,9 @@ |
||
| 99 | 99 | return $user; |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | + /** |
|
| 103 | + * @param \WP_User|null $user |
|
| 104 | + */ |
|
| 102 | 105 | public function expand_user( $user ) { |
| 103 | 106 | if ( ! is_object( $user ) ) { |
| 104 | 107 | return null; |