@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | * Validate the require two step checkbox in Settings > General |
| 263 | 263 | * |
| 264 | 264 | * @since 2.7 |
| 265 | - * @return boolean |
|
| 265 | + * @return integer |
|
| 266 | 266 | **/ |
| 267 | 267 | public function validate_jetpack_sso_require_two_step( $input ) { |
| 268 | 268 | return ( ! empty( $input ) ) ? 1 : 0; |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | * Validate the match by email check in Settings > General |
| 288 | 288 | * |
| 289 | 289 | * @since 2.9 |
| 290 | - * @return boolean |
|
| 290 | + * @return integer |
|
| 291 | 291 | **/ |
| 292 | 292 | public function validate_jetpack_sso_match_by_email( $input ) { |
| 293 | 293 | return ( ! empty( $input ) ) ? 1 : 0; |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | * |
| 68 | 68 | * @param string $object_type Type of the sync object. |
| 69 | 69 | * @param int $id ID of the sync object. |
| 70 | - * @return mixed Object, or false if the object is invalid. |
|
| 70 | + * @return boolean Object, or false if the object is invalid. |
|
| 71 | 71 | */ |
| 72 | 72 | public function get_object_by_id( $object_type, $id ) { |
| 73 | 73 | return false; |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | * |
| 125 | 125 | * @access public |
| 126 | 126 | * |
| 127 | - * @param array $config Full sync configuration for this sync module. |
|
| 127 | + * @param boolean $config Full sync configuration for this sync module. |
|
| 128 | 128 | * @param int $max_items_to_enqueue Maximum number of items to enqueue. |
| 129 | 129 | * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. |
| 130 | 130 | * @return array Number of actions enqueued, and next module state. |
@@ -166,8 +166,8 @@ discard block |
||
| 166 | 166 | * @access protected |
| 167 | 167 | * |
| 168 | 168 | * @param array $action_names Action names we're interested in. |
| 169 | - * @param array $actions_to_count Unfiltered list of actions we want to count. |
|
| 170 | - * @return array Number of actions that we're interested in. |
|
| 169 | + * @param string[] $actions_to_count Unfiltered list of actions we want to count. |
|
| 170 | + * @return integer Number of actions that we're interested in. |
|
| 171 | 171 | */ |
| 172 | 172 | protected function count_actions( $action_names, $actions_to_count ) { |
| 173 | 173 | return count( array_intersect( $action_names, $actions_to_count ) ); |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | /** |
| 286 | 286 | * Given the Module Full Sync Configuration and Status return the next chunk of items to send. |
| 287 | 287 | * |
| 288 | - * @param array $config This module Full Sync configuration. |
|
| 288 | + * @param string $config This module Full Sync configuration. |
|
| 289 | 289 | * @param array $status This module Full Sync status. |
| 290 | 290 | * @param int $chunk_size Chunk size. |
| 291 | 291 | * |
@@ -352,6 +352,9 @@ discard block |
||
| 352 | 352 | return Grunion_Contact_Form::parse( $atts, do_blocks( $content ) ); |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | + /** |
|
| 356 | + * @param string $type |
|
| 357 | + */ |
|
| 355 | 358 | public static function block_attributes_to_shortcode_attributes( $atts, $type ) { |
| 356 | 359 | $atts['type'] = $type; |
| 357 | 360 | if ( isset( $atts['className'] ) ) { |
@@ -403,6 +406,10 @@ discard block |
||
| 403 | 406 | $atts = self::block_attributes_to_shortcode_attributes( $atts, 'checkbox-multiple' ); |
| 404 | 407 | return Grunion_Contact_Form::parse_contact_field( $atts, $content ); |
| 405 | 408 | } |
| 409 | + |
|
| 410 | + /** |
|
| 411 | + * @param string $content |
|
| 412 | + */ |
|
| 406 | 413 | public static function gutenblock_render_field_radio( $atts, $content ) { |
| 407 | 414 | $atts = self::block_attributes_to_shortcode_attributes( $atts, 'radio' ); |
| 408 | 415 | return Grunion_Contact_Form::parse_contact_field( $atts, $content ); |
@@ -2045,7 +2052,6 @@ discard block |
||
| 2045 | 2052 | * |
| 2046 | 2053 | * @see ::style() |
| 2047 | 2054 | * @internal |
| 2048 | - * @param bool $style |
|
| 2049 | 2055 | */ |
| 2050 | 2056 | static function _style_on() { |
| 2051 | 2057 | return self::style( true ); |
@@ -2236,6 +2242,7 @@ discard block |
||
| 2236 | 2242 | * |
| 2237 | 2243 | * @param int $feedback_id |
| 2238 | 2244 | * @param object Grunion_Contact_Form $form |
| 2245 | + * @param Grunion_Contact_Form $form |
|
| 2239 | 2246 | * |
| 2240 | 2247 | * @return string $message |
| 2241 | 2248 | */ |
@@ -2394,7 +2401,7 @@ discard block |
||
| 2394 | 2401 | * |
| 2395 | 2402 | * @param array $attributes Key => Value pairs as parsed by shortcode_parse_atts() |
| 2396 | 2403 | * @param string|null $content The shortcode's inner content: [contact-field]$content[/contact-field] |
| 2397 | - * @return HTML for the contact form field |
|
| 2404 | + * @return string for the contact form field |
|
| 2398 | 2405 | */ |
| 2399 | 2406 | static function parse_contact_field( $attributes, $content ) { |
| 2400 | 2407 | // Don't try to parse contact form fields if not inside a contact form |
@@ -3523,6 +3530,9 @@ discard block |
||
| 3523 | 3530 | |
| 3524 | 3531 | } |
| 3525 | 3532 | |
| 3533 | + /** |
|
| 3534 | + * @param string $type |
|
| 3535 | + */ |
|
| 3526 | 3536 | function render_input_field( $type, $id, $value, $class, $placeholder, $required ) { |
| 3527 | 3537 | return "<input |
| 3528 | 3538 | type='". esc_attr( $type ) ."' |
@@ -3534,24 +3544,40 @@ discard block |
||
| 3534 | 3544 | />\n"; |
| 3535 | 3545 | } |
| 3536 | 3546 | |
| 3547 | + /** |
|
| 3548 | + * @param string $class |
|
| 3549 | + * @param string $placeholder |
|
| 3550 | + */ |
|
| 3537 | 3551 | function render_email_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
| 3538 | 3552 | $field = $this->render_label( 'email', $id, $label, $required, $required_field_text ); |
| 3539 | 3553 | $field .= $this->render_input_field( 'email', $id, $value, $class, $placeholder, $required ); |
| 3540 | 3554 | return $field; |
| 3541 | 3555 | } |
| 3542 | 3556 | |
| 3557 | + /** |
|
| 3558 | + * @param string $class |
|
| 3559 | + * @param string $placeholder |
|
| 3560 | + */ |
|
| 3543 | 3561 | function render_telephone_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
| 3544 | 3562 | $field = $this->render_label( 'telephone', $id, $label, $required, $required_field_text ); |
| 3545 | 3563 | $field .= $this->render_input_field( 'tel', $id, $value, $class, $placeholder, $required ); |
| 3546 | 3564 | return $field; |
| 3547 | 3565 | } |
| 3548 | 3566 | |
| 3567 | + /** |
|
| 3568 | + * @param string $class |
|
| 3569 | + * @param string $placeholder |
|
| 3570 | + */ |
|
| 3549 | 3571 | function render_url_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
| 3550 | 3572 | $field = $this->render_label( 'url', $id, $label, $required, $required_field_text ); |
| 3551 | 3573 | $field .= $this->render_input_field( 'url', $id, $value, $class, $placeholder, $required ); |
| 3552 | 3574 | return $field; |
| 3553 | 3575 | } |
| 3554 | 3576 | |
| 3577 | + /** |
|
| 3578 | + * @param string $class |
|
| 3579 | + * @param string $placeholder |
|
| 3580 | + */ |
|
| 3555 | 3581 | function render_textarea_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
| 3556 | 3582 | $field = $this->render_label( 'textarea', 'contact-form-comment-' . $id, $label, $required, $required_field_text ); |
| 3557 | 3583 | $field .= "<textarea |
@@ -3566,6 +3592,9 @@ discard block |
||
| 3566 | 3592 | return $field; |
| 3567 | 3593 | } |
| 3568 | 3594 | |
| 3595 | + /** |
|
| 3596 | + * @param string $class |
|
| 3597 | + */ |
|
| 3569 | 3598 | function render_radio_field( $id, $label, $value, $class, $required, $required_field_text ) { |
| 3570 | 3599 | $field = $this->render_label( '', $id, $label, $required, $required_field_text ); |
| 3571 | 3600 | foreach ( (array) $this->get_attribute( 'options' ) as $optionIndex => $option ) { |
@@ -3587,6 +3616,9 @@ discard block |
||
| 3587 | 3616 | return $field; |
| 3588 | 3617 | } |
| 3589 | 3618 | |
| 3619 | + /** |
|
| 3620 | + * @param string $class |
|
| 3621 | + */ |
|
| 3590 | 3622 | function render_checkbox_field( $id, $label, $value, $class, $required, $required_field_text ) { |
| 3591 | 3623 | $field = "<label class='grunion-field-label checkbox" . ( $this->is_error() ? ' form-error' : '' ) . "'>"; |
| 3592 | 3624 | $field .= "\t\t<input type='checkbox' name='" . esc_attr( $id ) . "' value='" . esc_attr__( 'Yes', 'jetpack' ) . "' " . $class . checked( (bool) $value, true, false ) . ' ' . ( $required ? "required aria-required='true'" : '' ) . "/> \n"; |
@@ -3619,6 +3651,9 @@ discard block |
||
| 3619 | 3651 | return $field; |
| 3620 | 3652 | } |
| 3621 | 3653 | |
| 3654 | + /** |
|
| 3655 | + * @param string $class |
|
| 3656 | + */ |
|
| 3622 | 3657 | function render_checkbox_multiple_field( $id, $label, $value, $class, $required, $required_field_text ) { |
| 3623 | 3658 | $field = $this->render_label( '', $id, $label, $required, $required_field_text ); |
| 3624 | 3659 | foreach ( (array) $this->get_attribute( 'options' ) as $optionIndex => $option ) { |
@@ -3634,6 +3669,9 @@ discard block |
||
| 3634 | 3669 | return $field; |
| 3635 | 3670 | } |
| 3636 | 3671 | |
| 3672 | + /** |
|
| 3673 | + * @param string $class |
|
| 3674 | + */ |
|
| 3637 | 3675 | function render_select_field( $id, $label, $value, $class, $required, $required_field_text ) { |
| 3638 | 3676 | $field = $this->render_label( 'select', $id, $label, $required, $required_field_text ); |
| 3639 | 3677 | $field .= "\t<select name='" . esc_attr( $id ) . "' id='" . esc_attr( $id ) . "' " . $class . ( $required ? "required aria-required='true'" : '' ) . ">\n"; |
@@ -3651,6 +3689,10 @@ discard block |
||
| 3651 | 3689 | return $field; |
| 3652 | 3690 | } |
| 3653 | 3691 | |
| 3692 | + /** |
|
| 3693 | + * @param string $class |
|
| 3694 | + * @param string $placeholder |
|
| 3695 | + */ |
|
| 3654 | 3696 | function render_date_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder ) { |
| 3655 | 3697 | |
| 3656 | 3698 | $field = $this->render_label( 'date', $id, $label, $required, $required_field_text ); |
@@ -3681,6 +3723,10 @@ discard block |
||
| 3681 | 3723 | return $field; |
| 3682 | 3724 | } |
| 3683 | 3725 | |
| 3726 | + /** |
|
| 3727 | + * @param string $class |
|
| 3728 | + * @param string $placeholder |
|
| 3729 | + */ |
|
| 3684 | 3730 | function render_default_field( $id, $label, $value, $class, $required, $required_field_text, $placeholder, $type ) { |
| 3685 | 3731 | $field = $this->render_label( $type, $id, $label, $required, $required_field_text ); |
| 3686 | 3732 | $field .= $this->render_input_field( 'text', $id, $value, $class, $placeholder, $required ); |
@@ -177,10 +177,10 @@ |
||
| 177 | 177 | * @since 4.3.0 |
| 178 | 178 | * @since 4.6.0 Added public-api.wordpress.com as an allowed redirect |
| 179 | 179 | * |
| 180 | - * @param array $hosts |
|
| 180 | + * @param string[] $hosts |
|
| 181 | 181 | * @param string $api_base |
| 182 | 182 | * |
| 183 | - * @return array |
|
| 183 | + * @return string[] |
|
| 184 | 184 | */ |
| 185 | 185 | static function allowed_redirect_hosts( $hosts, $api_base = JETPACK__API_BASE ) { |
| 186 | 186 | if ( empty( $hosts ) ) { |
@@ -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; |
@@ -639,6 +639,7 @@ discard block |
||
| 639 | 639 | * Fetch latest Jetpack version. |
| 640 | 640 | * |
| 641 | 641 | * @param bool $is_dev_version - If JP Dev version is being queried. |
| 642 | + * @return string |
|
| 642 | 643 | */ |
| 643 | 644 | public static function get_new_jetpack_version( $is_dev_version = false ) { |
| 644 | 645 | $manifest = self::get_beta_manifest(); |
@@ -714,6 +715,7 @@ discard block |
||
| 714 | 715 | * |
| 715 | 716 | * @param string $branch - Branch. |
| 716 | 717 | * @param string $section - Section. |
| 718 | + * @return string |
|
| 717 | 719 | */ |
| 718 | 720 | public static function get_install_url( $branch = null, $section = null ) { |
| 719 | 721 | if ( is_null( $section ) ) { |
@@ -769,7 +771,7 @@ discard block |
||
| 769 | 771 | /** |
| 770 | 772 | * Get JP plugin data. |
| 771 | 773 | * |
| 772 | - * @param mixed $plugin_file - JP or JP Dev plugin path. |
|
| 774 | + * @param string $plugin_file - JP or JP Dev plugin path. |
|
| 773 | 775 | */ |
| 774 | 776 | public static function get_jetpack_plugin_info( $plugin_file = null ) { |
| 775 | 777 | |
@@ -1418,7 +1420,7 @@ discard block |
||
| 1418 | 1420 | /** |
| 1419 | 1421 | * Checks if a dir is empty. |
| 1420 | 1422 | * |
| 1421 | - * @param [type] $dir The absolute directory path to check. |
|
| 1423 | + * @param string $dir The absolute directory path to check. |
|
| 1422 | 1424 | * @return boolean |
| 1423 | 1425 | */ |
| 1424 | 1426 | public static function is_dir_empty( $dir ) { |
@@ -729,6 +729,7 @@ |
||
| 729 | 729 | * |
| 730 | 730 | * @param string $branch - Branch that's ready for update. |
| 731 | 731 | * @param string $section - What kind of branch we're updated (master, rc, pr). |
| 732 | + * @return string |
|
| 732 | 733 | */ |
| 733 | 734 | public static function update_action_url( $branch, $section ) { |
| 734 | 735 | $query = array( |