@@ -190,7 +190,7 @@ |
||
190 | 190 | * |
191 | 191 | * @param string $event_slug The slug of the event this reaction is for. |
192 | 192 | * |
193 | - * @return int|false The reaction ID, or false if not created. |
|
193 | + * @return integer The reaction ID, or false if not created. |
|
194 | 194 | */ |
195 | 195 | abstract protected function _create_reaction( $event_slug ); |
196 | 196 | } |
@@ -103,7 +103,7 @@ |
||
103 | 103 | * |
104 | 104 | * @param int|string $number The hook number or ID to get the points for. |
105 | 105 | * |
106 | - * @return int|false The number of points for this instance, or false. |
|
106 | + * @return integer The number of points for this instance, or false. |
|
107 | 107 | */ |
108 | 108 | public function get_points( $number = null ) { |
109 | 109 |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | |
116 | 116 | $instances = $this->get_instances(); |
117 | 117 | |
118 | - if ( isset( $instances[ $number ]['points'] ) ) { |
|
119 | - return $instances[ $number ]['points']; |
|
118 | + if ( isset( $instances[$number]['points'] ) ) { |
|
119 | + return $instances[$number]['points']; |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | return false; |
@@ -340,9 +340,9 @@ discard block |
||
340 | 340 | */ |
341 | 341 | final public function get_option( $option ) { |
342 | 342 | |
343 | - if ( isset( $this->options[ $option ] ) ) { |
|
343 | + if ( isset( $this->options[$option] ) ) { |
|
344 | 344 | |
345 | - return $this->options[ $option ]; |
|
345 | + return $this->options[$option]; |
|
346 | 346 | } |
347 | 347 | |
348 | 348 | return null; |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | */ |
372 | 372 | final public function set_option( $option, $value ) { |
373 | 373 | |
374 | - $this->options[ $option ] = $value; |
|
374 | + $this->options[$option] = $value; |
|
375 | 375 | } |
376 | 376 | |
377 | 377 | /** |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | |
437 | 437 | if ( is_multisite() ) { |
438 | 438 | foreach ( wordpoints_get_array_option( $this->option_name, 'site' ) as $number => $instance ) { |
439 | - $instances[ 'network_' . $number ] = $instance; |
|
439 | + $instances['network_' . $number] = $instance; |
|
440 | 440 | } |
441 | 441 | } |
442 | 442 | break; |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | |
471 | 471 | $this->set_number( $number ); |
472 | 472 | |
473 | - $old_instance = isset( $all_instances[ $this->number ] ) ? $all_instances[ $this->number ] : array(); |
|
473 | + $old_instance = isset( $all_instances[$this->number] ) ? $all_instances[$this->number] : array(); |
|
474 | 474 | |
475 | 475 | $instance = $this->update( $new_instance, $old_instance ); |
476 | 476 | |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | $instance = apply_filters( 'wordpoints_points_hook_update_callback', $instance, $new_instance, $old_instance, $this ); |
492 | 492 | |
493 | 493 | if ( false !== $instance ) { |
494 | - $all_instances[ $this->number ] = $instance; |
|
494 | + $all_instances[$this->number] = $instance; |
|
495 | 495 | } |
496 | 496 | |
497 | 497 | $this->save_instances( $all_instances ); |
@@ -517,9 +517,9 @@ discard block |
||
517 | 517 | |
518 | 518 | $number = $this->get_number_by_id( $hook_id ); |
519 | 519 | |
520 | - if ( isset( $all_instances[ $number ] ) ) { |
|
520 | + if ( isset( $all_instances[$number] ) ) { |
|
521 | 521 | |
522 | - unset( $all_instances[ $number ] ); |
|
522 | + unset( $all_instances[$number] ); |
|
523 | 523 | |
524 | 524 | $this->save_instances( $all_instances ); |
525 | 525 | } |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | |
555 | 555 | } else { |
556 | 556 | |
557 | - $instance = $all_instances[ $this->number ]; |
|
557 | + $instance = $all_instances[$this->number]; |
|
558 | 558 | } |
559 | 559 | |
560 | 560 | /** |
@@ -673,11 +673,11 @@ discard block |
||
673 | 673 | |
674 | 674 | $instances = $this->get_instances(); |
675 | 675 | |
676 | - if ( 'generated' !== $type && ! empty( $instances[ $this->number ]['_description'] ) ) { |
|
677 | - return $instances[ $this->number ]['_description']; |
|
676 | + if ( 'generated' !== $type && ! empty( $instances[$this->number]['_description'] ) ) { |
|
677 | + return $instances[$this->number]['_description']; |
|
678 | 678 | } |
679 | 679 | |
680 | - $instance = ( isset( $instances[ $this->number ] ) ) ? $instances[ $this->number ] : array(); |
|
680 | + $instance = ( isset( $instances[$this->number] ) ) ? $instances[$this->number] : array(); |
|
681 | 681 | |
682 | 682 | /** |
683 | 683 | * Filter the description for a points hook. |
@@ -421,7 +421,7 @@ |
||
421 | 421 | * @since 2.0.0 |
422 | 422 | * |
423 | 423 | * @param string $key The log meta key to match on. |
424 | - * @param mixed $value The log meta value to match on. |
|
424 | + * @param integer $value The log meta value to match on. |
|
425 | 425 | * @param string $new_key The key for the new meta value to add. |
426 | 426 | * @param mixed $new_value The new meta value to add. If falsey, new meta isn't added. |
427 | 427 | */ |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | * 'default', which will return a list of the most recent points logs, with |
295 | 295 | * users excluded according to the general settings. |
296 | 296 | * |
297 | - * @return WordPoints_Points_Logs_Query|false Logs query instance, or false. |
|
297 | + * @return WordPoints_Points_Logs_Query Logs query instance, or false. |
|
298 | 298 | */ |
299 | 299 | function wordpoints_get_points_logs_query( $points_type, $query_slug = 'default' ) { |
300 | 300 | |
@@ -466,6 +466,11 @@ discard block |
||
466 | 466 | * @since 1.9.0 |
467 | 467 | * |
468 | 468 | * @WordPress\action wordpoints_points_log-comment_disapprove |
469 | + * @param string $text |
|
470 | + * @param integer $points |
|
471 | + * @param string $points_type |
|
472 | + * @param integer $user_id |
|
473 | + * @param string $log_type |
|
469 | 474 | */ |
470 | 475 | function wordpoints_points_logs_comment_disapprove( $text, $points, $points_type, $user_id, $log_type, $meta ) { |
471 | 476 | |
@@ -492,6 +497,11 @@ discard block |
||
492 | 497 | * @since 1.9.0 |
493 | 498 | * |
494 | 499 | * @WordPress\action wordpoints_points_log-post_delete |
500 | + * @param string $text |
|
501 | + * @param integer $points |
|
502 | + * @param string $points_type |
|
503 | + * @param integer $user_id |
|
504 | + * @param string $log_type |
|
495 | 505 | */ |
496 | 506 | function wordpoints_points_logs_post_delete( $text, $points, $points_type, $user_id, $log_type, $meta ) { |
497 | 507 |
@@ -363,7 +363,7 @@ |
||
363 | 363 | * |
364 | 364 | * @param string $type The slug for a points type. |
365 | 365 | * |
366 | - * @return int|false The minimum for this type of points. False if $type is bad. |
|
366 | + * @return integer The minimum for this type of points. False if $type is bad. |
|
367 | 367 | */ |
368 | 368 | function wordpoints_get_points_minimum( $type ) { |
369 | 369 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | $points_types = wordpoints_get_points_types(); |
25 | 25 | |
26 | - return isset( $points_types[ $slug ] ); |
|
26 | + return isset( $points_types[$slug] ); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
@@ -71,11 +71,11 @@ discard block |
||
71 | 71 | |
72 | 72 | $points_types = wordpoints_get_points_types(); |
73 | 73 | |
74 | - if ( ! isset( $points_types[ $slug ] ) ) { |
|
74 | + if ( ! isset( $points_types[$slug] ) ) { |
|
75 | 75 | return false; |
76 | 76 | } |
77 | 77 | |
78 | - return $points_types[ $slug ]; |
|
78 | + return $points_types[$slug]; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -95,8 +95,8 @@ discard block |
||
95 | 95 | |
96 | 96 | $points_type = wordpoints_get_points_type( $slug ); |
97 | 97 | |
98 | - if ( isset( $points_type[ $setting ] ) ) { |
|
99 | - return $points_type[ $setting ]; |
|
98 | + if ( isset( $points_type[$setting] ) ) { |
|
99 | + return $points_type[$setting]; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | return null; |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | |
130 | 130 | $points_types = wordpoints_get_points_types(); |
131 | 131 | |
132 | - if ( empty( $slug ) || isset( $points_types[ $slug ] ) ) { |
|
132 | + if ( empty( $slug ) || isset( $points_types[$slug] ) ) { |
|
133 | 133 | return false; |
134 | 134 | } |
135 | 135 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | * @param string $slug The slug for this points type. |
143 | 143 | * @param bool $is_new Whether this points type is new, or being updated. |
144 | 144 | */ |
145 | - $points_types[ $slug ] = apply_filters( 'wordpoints_points_settings', $settings, $slug, true ); |
|
145 | + $points_types[$slug] = apply_filters( 'wordpoints_points_settings', $settings, $slug, true ); |
|
146 | 146 | |
147 | 147 | if ( ! wordpoints_update_maybe_network_option( 'wordpoints_points_types', $points_types ) ) { |
148 | 148 | return false; |
@@ -165,14 +165,14 @@ discard block |
||
165 | 165 | |
166 | 166 | $points_types = wordpoints_get_points_types(); |
167 | 167 | |
168 | - if ( ! is_array( $settings ) || ! isset( $points_types[ $slug ], $settings['name'] ) ) { |
|
168 | + if ( ! is_array( $settings ) || ! isset( $points_types[$slug], $settings['name'] ) ) { |
|
169 | 169 | return false; |
170 | 170 | } |
171 | 171 | |
172 | 172 | /** |
173 | 173 | * @see wordpoints_add_points_type() |
174 | 174 | */ |
175 | - $points_types[ $slug ] = apply_filters( 'wordpoints_points_settings', $settings, $slug, false ); |
|
175 | + $points_types[$slug] = apply_filters( 'wordpoints_points_settings', $settings, $slug, false ); |
|
176 | 176 | |
177 | 177 | return wordpoints_update_maybe_network_option( 'wordpoints_points_types', $points_types ); |
178 | 178 | } |
@@ -1035,13 +1035,13 @@ discard block |
||
1035 | 1035 | , array( '%d' ) |
1036 | 1036 | ); |
1037 | 1037 | |
1038 | - if ( ! isset( $flushed['points_types'][ $log->points_type ], $flushed['user_ids'][ $log->user_id ] ) ) { |
|
1038 | + if ( ! isset( $flushed['points_types'][$log->points_type], $flushed['user_ids'][$log->user_id] ) ) { |
|
1039 | 1039 | wordpoints_flush_points_logs_caches( |
1040 | 1040 | array( 'user_id' => $log->user_id, 'points_type' => $log->points_type ) |
1041 | 1041 | ); |
1042 | 1042 | |
1043 | - $flushed['points_types'][ $log->points_type ] = true; |
|
1044 | - $flushed['user_ids'][ $log->user_id ] = true; |
|
1043 | + $flushed['points_types'][$log->points_type] = true; |
|
1044 | + $flushed['user_ids'][$log->user_id] = true; |
|
1045 | 1045 | } |
1046 | 1046 | } |
1047 | 1047 |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | * |
174 | 174 | * @param mixed $maybe_int The value to convert to an integer. |
175 | 175 | * |
176 | - * @return int|false False if $maybe_int couldn't reliably be converted to an integer. |
|
176 | + * @return integer False if $maybe_int couldn't reliably be converted to an integer. |
|
177 | 177 | */ |
178 | 178 | function wordpoints_int( &$maybe_int ) { |
179 | 179 | |
@@ -969,7 +969,7 @@ discard block |
||
969 | 969 | * @since 1.0.1 |
970 | 970 | * @since 1.8.0 The $message now supports WP_Error objects. |
971 | 971 | * |
972 | - * @param string|WP_Error $message The error message. |
|
972 | + * @param string $message The error message. |
|
973 | 973 | * |
974 | 974 | * @return string The error message. |
975 | 975 | */ |
@@ -88,7 +88,8 @@ discard block |
||
88 | 88 | */ |
89 | 89 | function wordpoints_maintenance_shutdown_print_rand_str() { |
90 | 90 | |
91 | - if ( ! isset( $_GET['wordpoints_module_check'] ) ) { // WPCS: CSRF OK. |
|
91 | + if ( ! isset( $_GET['wordpoints_module_check'] ) ) { |
|
92 | +// WPCS: CSRF OK. |
|
92 | 93 | return; |
93 | 94 | } |
94 | 95 | |
@@ -98,7 +99,8 @@ discard block |
||
98 | 99 | $nonce = get_option( 'wordpoints_module_check_nonce' ); |
99 | 100 | } |
100 | 101 | |
101 | - if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET['wordpoints_module_check'] ) ) ) { // WPCS: CSRF OK. |
|
102 | + if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET['wordpoints_module_check'] ) ) ) { |
|
103 | +// WPCS: CSRF OK. |
|
102 | 104 | return; |
103 | 105 | } |
104 | 106 | |
@@ -128,7 +130,8 @@ discard block |
||
128 | 130 | */ |
129 | 131 | function wordpoints_maintenance_filter_modules( $modules ) { |
130 | 132 | |
131 | - if ( ! isset( $_GET['check_module'], $_GET['wordpoints_module_check'] ) ) { // WPCS: CSRF OK. |
|
133 | + if ( ! isset( $_GET['check_module'], $_GET['wordpoints_module_check'] ) ) { |
|
134 | +// WPCS: CSRF OK. |
|
132 | 135 | return $modules; |
133 | 136 | } |
134 | 137 | |
@@ -138,7 +141,8 @@ discard block |
||
138 | 141 | $nonce = get_option( 'wordpoints_module_check_nonce' ); |
139 | 142 | } |
140 | 143 | |
141 | - if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET['wordpoints_module_check'] ) ) ) { // WPCS: CSRF OK. |
|
144 | + if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET['wordpoints_module_check'] ) ) ) { |
|
145 | +// WPCS: CSRF OK. |
|
142 | 146 | return $modules; |
143 | 147 | } |
144 | 148 |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | $request = $_GET; // WPCS: CSRF OK. |
340 | 340 | } |
341 | 341 | |
342 | - if ( ! isset( $request[ $nonce_key ] ) ) { |
|
342 | + if ( ! isset( $request[$nonce_key] ) ) { |
|
343 | 343 | return false; |
344 | 344 | } |
345 | 345 | |
@@ -349,18 +349,18 @@ discard block |
||
349 | 349 | |
350 | 350 | foreach ( (array) $format_values as $value ) { |
351 | 351 | |
352 | - if ( ! isset( $request[ $value ] ) ) { |
|
352 | + if ( ! isset( $request[$value] ) ) { |
|
353 | 353 | return false; |
354 | 354 | } |
355 | 355 | |
356 | - $values[] = $request[ $value ]; |
|
356 | + $values[] = $request[$value]; |
|
357 | 357 | } |
358 | 358 | |
359 | 359 | $action_format = vsprintf( $action_format, $values ); |
360 | 360 | } |
361 | 361 | |
362 | 362 | $is_valid = wp_verify_nonce( |
363 | - sanitize_key( $request[ $nonce_key ] ) |
|
363 | + sanitize_key( $request[$nonce_key] ) |
|
364 | 364 | , strip_tags( $action_format ) |
365 | 365 | ); |
366 | 366 | |
@@ -395,10 +395,10 @@ discard block |
||
395 | 395 | |
396 | 396 | $error_data = $error->error_data; |
397 | 397 | |
398 | - if ( isset( $error_data[ $code ]['title'] ) ) { |
|
398 | + if ( isset( $error_data[$code]['title'] ) ) { |
|
399 | 399 | |
400 | - $error_data[ $code ]['title'] = wp_kses( |
|
401 | - $error->error_data[ $code ]['title'] |
|
400 | + $error_data[$code]['title'] = wp_kses( |
|
401 | + $error->error_data[$code]['title'] |
|
402 | 402 | , 'wordpoints_sanitize_wp_error_title' |
403 | 403 | ); |
404 | 404 | |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | foreach ( $all_errors as $code => $errors ) { |
411 | 411 | |
412 | 412 | foreach ( $errors as $key => $message ) { |
413 | - $all_errors[ $code ][ $key ] = wp_kses( |
|
413 | + $all_errors[$code][$key] = wp_kses( |
|
414 | 414 | $message |
415 | 415 | , 'wordpoints_sanitize_wp_error_message' |
416 | 416 | ); |
@@ -998,15 +998,15 @@ discard block |
||
998 | 998 | 'delete_wordpoints_modules' => 'delete_wordpoints_extensions', |
999 | 999 | ); |
1000 | 1000 | |
1001 | - if ( isset( $deprecated[ $cap ] ) ) { |
|
1001 | + if ( isset( $deprecated[$cap] ) ) { |
|
1002 | 1002 | |
1003 | 1003 | _deprecated_argument( |
1004 | 1004 | 'current_user_can' |
1005 | 1005 | , '2.4.0' |
1006 | - , esc_html( "{$cap} is deprecated, use {$deprecated[ $cap ]} instead." ) |
|
1006 | + , esc_html( "{$cap} is deprecated, use {$deprecated[$cap]} instead." ) |
|
1007 | 1007 | ); |
1008 | 1008 | |
1009 | - $caps[] = $deprecated[ $cap ]; |
|
1009 | + $caps[] = $deprecated[$cap]; |
|
1010 | 1010 | } |
1011 | 1011 | |
1012 | 1012 | switch ( $cap ) { |
@@ -1276,26 +1276,26 @@ discard block |
||
1276 | 1276 | |
1277 | 1277 | foreach ( $map as $shortcut => $canonicals ) { |
1278 | 1278 | |
1279 | - if ( ! isset( $array[ $shortcut ] ) ) { |
|
1279 | + if ( ! isset( $array[$shortcut] ) ) { |
|
1280 | 1280 | continue; |
1281 | 1281 | } |
1282 | 1282 | |
1283 | 1283 | foreach ( $canonicals as $canonical ) { |
1284 | 1284 | |
1285 | - if ( ! isset( $array[ $canonical ] ) ) { |
|
1285 | + if ( ! isset( $array[$canonical] ) ) { |
|
1286 | 1286 | |
1287 | - $array[ $canonical ] = $array[ $shortcut ]; |
|
1287 | + $array[$canonical] = $array[$shortcut]; |
|
1288 | 1288 | |
1289 | 1289 | } else { |
1290 | 1290 | |
1291 | - $array[ $canonical ] = array_merge( |
|
1292 | - $array[ $canonical ] |
|
1293 | - , $array[ $shortcut ] |
|
1291 | + $array[$canonical] = array_merge( |
|
1292 | + $array[$canonical] |
|
1293 | + , $array[$shortcut] |
|
1294 | 1294 | ); |
1295 | 1295 | } |
1296 | 1296 | } |
1297 | 1297 | |
1298 | - unset( $array[ $shortcut ] ); |
|
1298 | + unset( $array[$shortcut] ); |
|
1299 | 1299 | } |
1300 | 1300 | |
1301 | 1301 | return $array; |
@@ -92,6 +92,7 @@ discard block |
||
92 | 92 | * |
93 | 93 | * @param string $parent_slug The group slug. |
94 | 94 | * @param string $slug The slug of the class to deregister. |
95 | + * @return void |
|
95 | 96 | */ |
96 | 97 | public function deregister( $parent_slug, $slug ); |
97 | 98 | |
@@ -101,6 +102,7 @@ discard block |
||
101 | 102 | * @since 2.1.0 |
102 | 103 | * |
103 | 104 | * @param string $parent_slug The group slug. |
105 | + * @return void |
|
104 | 106 | */ |
105 | 107 | public function deregister_children( $parent_slug ); |
106 | 108 |
@@ -76,6 +76,7 @@ discard block |
||
76 | 76 | * @param string $slug The slug of the class to deregister. |
77 | 77 | * @param string[] $parent_slugs The slug(s) of the class's parent(s) in the |
78 | 78 | * hierarchy. |
79 | + * @return void |
|
79 | 80 | */ |
80 | 81 | public function deregister( $slug, array $parent_slugs = array() ); |
81 | 82 | |
@@ -85,6 +86,7 @@ discard block |
||
85 | 86 | * @since 2.2.0 |
86 | 87 | * |
87 | 88 | * @param string[] $parent_slugs The hierarchy of the parent. |
89 | + * @return void |
|
88 | 90 | */ |
89 | 91 | public function deregister_children( array $parent_slugs = array() ); |
90 | 92 |
@@ -71,6 +71,7 @@ |
||
71 | 71 | * @since 2.1.0 |
72 | 72 | * |
73 | 73 | * @param string $slug The slug of the class to deregister. |
74 | + * @return void |
|
74 | 75 | */ |
75 | 76 | public function deregister( $slug ); |
76 | 77 |