@@ -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 ); |
@@ -388,6 +388,9 @@ discard block |
||
| 388 | 388 | do_action( 'sharing_bump_stats', array( 'service' => $this, 'post' => $post ) ); |
| 389 | 389 | } |
| 390 | 390 | |
| 391 | + /** |
|
| 392 | + * @param string $name |
|
| 393 | + */ |
|
| 391 | 394 | public function js_dialog( $name, $params = array() ) { |
| 392 | 395 | if ( true !== $this->open_link_in_new ) { |
| 393 | 396 | return; |
@@ -1039,6 +1042,9 @@ discard block |
||
| 1039 | 1042 | public $icon = '\f204'; |
| 1040 | 1043 | private $share_type = 'default'; |
| 1041 | 1044 | |
| 1045 | + /** |
|
| 1046 | + * @param string $id |
|
| 1047 | + */ |
|
| 1042 | 1048 | public function __construct( $id, array $settings ) { |
| 1043 | 1049 | parent::__construct( $id, $settings ); |
| 1044 | 1050 | |
@@ -1186,6 +1192,10 @@ discard block |
||
| 1186 | 1192 | class Share_Print extends Sharing_Source { |
| 1187 | 1193 | public $shortname = 'print'; |
| 1188 | 1194 | public $icon = '\f469'; |
| 1195 | + |
|
| 1196 | + /** |
|
| 1197 | + * @param string $id |
|
| 1198 | + */ |
|
| 1189 | 1199 | public function __construct( $id, array $settings ) { |
| 1190 | 1200 | parent::__construct( $id, $settings ); |
| 1191 | 1201 | |
@@ -1585,6 +1595,9 @@ discard block |
||
| 1585 | 1595 | return __( 'Pinterest', 'jetpack' ); |
| 1586 | 1596 | } |
| 1587 | 1597 | |
| 1598 | + /** |
|
| 1599 | + * @return string |
|
| 1600 | + */ |
|
| 1588 | 1601 | public function get_image( $post ) { |
| 1589 | 1602 | if ( class_exists( 'Jetpack_PostImages' ) ) { |
| 1590 | 1603 | $image = Jetpack_PostImages::get_image( $post->ID, array( 'fallback_to_avatars' => true ) ); |
@@ -1724,6 +1737,9 @@ discard block |
||
| 1724 | 1737 | public $shortname = 'pocket'; |
| 1725 | 1738 | public $icon = '\f224'; |
| 1726 | 1739 | |
| 1740 | + /** |
|
| 1741 | + * @param string $id |
|
| 1742 | + */ |
|
| 1727 | 1743 | public function __construct( $id, array $settings ) { |
| 1728 | 1744 | parent::__construct( $id, $settings ); |
| 1729 | 1745 | |
@@ -1839,6 +1855,9 @@ discard block |
||
| 1839 | 1855 | class Jetpack_Share_WhatsApp extends Sharing_Source { |
| 1840 | 1856 | public $shortname = 'jetpack-whatsapp'; |
| 1841 | 1857 | |
| 1858 | + /** |
|
| 1859 | + * @param string $id |
|
| 1860 | + */ |
|
| 1842 | 1861 | public function __construct( $id, array $settings ) { |
| 1843 | 1862 | parent::__construct( $id, $settings ); |
| 1844 | 1863 | } |
@@ -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 ] ) ) { |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * |
| 92 | 92 | * @param $function array A function structure to apply to the query |
| 93 | 93 | * |
| 94 | - * @return void |
|
| 94 | + * @return Jetpack_WPES_Query_Builder |
|
| 95 | 95 | */ |
| 96 | 96 | public function add_weighting_function( $function ) { |
| 97 | 97 | // check for danger. |
@@ -114,10 +114,10 @@ discard block |
||
| 114 | 114 | * |
| 115 | 115 | * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html |
| 116 | 116 | * |
| 117 | - * @param $function string name of the function |
|
| 117 | + * @param string $function string name of the function |
|
| 118 | 118 | * @param $params array functions parameters |
| 119 | 119 | * |
| 120 | - * @return void |
|
| 120 | + * @return Jetpack_WPES_Query_Builder |
|
| 121 | 121 | */ |
| 122 | 122 | public function add_function( $function, $params ) { |
| 123 | 123 | $this->functions[ $function ][] = $params; |
@@ -133,10 +133,10 @@ discard block |
||
| 133 | 133 | * |
| 134 | 134 | * @see https://www.elastic.co/guide/en/elasticsearch/guide/current/decay-functions.html |
| 135 | 135 | * |
| 136 | - * @param $function string name of the decay function - linear, exp, or gauss |
|
| 136 | + * @param string $function string name of the decay function - linear, exp, or gauss |
|
| 137 | 137 | * @param $params array The decay functions parameters, passed to ES directly |
| 138 | 138 | * |
| 139 | - * @return void |
|
| 139 | + * @return Jetpack_WPES_Query_Builder |
|
| 140 | 140 | */ |
| 141 | 141 | public function add_decay( $function, $params ) { |
| 142 | 142 | $this->decays[ $function ][] = $params; |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * |
| 152 | 152 | * @param $mode string name of how to score |
| 153 | 153 | * |
| 154 | - * @return void |
|
| 154 | + * @return Jetpack_WPES_Query_Builder |
|
| 155 | 155 | */ |
| 156 | 156 | public function add_score_mode_to_functions( $mode='multiply' ) { |
| 157 | 157 | $this->functions_score_mode = $mode; |
@@ -177,6 +177,9 @@ discard block |
||
| 177 | 177 | return $this; |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | + /** |
|
| 181 | + * @param string $aggs_name |
|
| 182 | + */ |
|
| 180 | 183 | public function add_aggs( $aggs_name, $aggs ) { |
| 181 | 184 | $this->aggs_query = true; |
| 182 | 185 | $this->aggs[$aggs_name] = $aggs; |
@@ -22,6 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * Scan every PHP in the root |
| 25 | + * @param string $root |
|
| 25 | 26 | */ |
| 26 | 27 | public function scan( $root, $exclude = array() ) { |
| 27 | 28 | if ( is_dir( $root ) ) { |
@@ -33,6 +34,9 @@ discard block |
||
| 33 | 34 | } |
| 34 | 35 | } |
| 35 | 36 | |
| 37 | + /** |
|
| 38 | + * @param string $root |
|
| 39 | + */ |
|
| 36 | 40 | public function scan_dir( $root, $exclude = array() ) { |
| 37 | 41 | |
| 38 | 42 | if ( is_null( $exclude ) || ! is_array( $exclude ) ) { |
@@ -124,7 +124,7 @@ |
||
| 124 | 124 | * @param int $cutoff_timestamp All nonces added before this timestamp will be removed. |
| 125 | 125 | * @param int $time_limit How long the cleanup can run (in seconds). |
| 126 | 126 | * |
| 127 | - * @return true |
|
| 127 | + * @return boolean |
|
| 128 | 128 | */ |
| 129 | 129 | public function clean_all( $cutoff_timestamp = PHP_INT_MAX, $time_limit = 20 ) { |
| 130 | 130 | // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed |