@@ -410,7 +410,7 @@ |
||
| 410 | 410 | * |
| 411 | 411 | * @param Mixed $needle the needle. |
| 412 | 412 | * @param Array $haystack the haystack. |
| 413 | - * @return is the needle not in the haystack? |
|
| 413 | + * @return boolean the needle not in the haystack? |
|
| 414 | 414 | */ |
| 415 | 415 | protected function negative_in_array( $needle, $haystack ) { |
| 416 | 416 | if ( in_array( $needle, $haystack, true ) ) { |
@@ -221,7 +221,7 @@ |
||
| 221 | 221 | /** |
| 222 | 222 | * Filter and replace HTML element. |
| 223 | 223 | * |
| 224 | - * @param array $matches Array of matches. |
|
| 224 | + * @param string[] $matches Array of matches. |
|
| 225 | 225 | */ |
| 226 | 226 | private static function dispatch( $matches ) { |
| 227 | 227 | $html = preg_replace( '%�*58;//%', '://', $matches[0] ); |
@@ -271,6 +271,9 @@ discard block |
||
| 271 | 271 | } |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | + /** |
|
| 275 | + * @param string $type |
|
| 276 | + */ |
|
| 274 | 277 | static function get_video_poster( $type, $id ) { |
| 275 | 278 | if ( 'videopress' == $type ) { |
| 276 | 279 | if ( function_exists( 'video_get_highest_resolution_image_url' ) ) { |
@@ -356,6 +359,9 @@ discard block |
||
| 356 | 359 | return (int) count( self::split_content_in_words( self::clean_text( $post_content ) ) ); |
| 357 | 360 | } |
| 358 | 361 | |
| 362 | + /** |
|
| 363 | + * @param string $excerpt_content |
|
| 364 | + */ |
|
| 359 | 365 | static function get_word_remaining_count( $post_content, $excerpt_content ) { |
| 360 | 366 | $content_word_count = count( self::split_content_in_words( self::clean_text( $post_content ) ) ); |
| 361 | 367 | $excerpt_word_count = count( self::split_content_in_words( self::clean_text( $excerpt_content ) ) ); |
@@ -199,7 +199,7 @@ |
||
| 199 | 199 | * @param string $type Test type, async or direct. Optional, direct all tests. |
| 200 | 200 | * @param string $group Testing group to check status of. Optional, default all tests. |
| 201 | 201 | * |
| 202 | - * @return true|array True if all tests pass. Array of failed tests. |
|
| 202 | + * @return boolean True if all tests pass. Array of failed tests. |
|
| 203 | 203 | */ |
| 204 | 204 | public function pass( $type = 'all', $group = 'all' ) { |
| 205 | 205 | $results = $this->raw_results( $type, $group ); |
@@ -416,7 +416,7 @@ |
||
| 416 | 416 | * Only enqueue block assets when needed. |
| 417 | 417 | * |
| 418 | 418 | * @param string $type Slug of the block. |
| 419 | - * @param array $script_dependencies Script dependencies. Will be merged with automatically |
|
| 419 | + * @param string[] $script_dependencies Script dependencies. Will be merged with automatically |
|
| 420 | 420 | * detected script dependencies from the webpack build. |
| 421 | 421 | * |
| 422 | 422 | * @return void |
@@ -129,6 +129,9 @@ discard block |
||
| 129 | 129 | return apply_filters( 'jp_carousel_load_for_images_linked_to_file', false ); |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | + /** |
|
| 133 | + * @param string $version |
|
| 134 | + */ |
|
| 132 | 135 | function asset_version( $version ) { |
| 133 | 136 | /** |
| 134 | 137 | * Filter the version string used when enqueuing Carousel assets. |
@@ -511,6 +514,9 @@ discard block |
||
| 511 | 514 | return $attr; |
| 512 | 515 | } |
| 513 | 516 | |
| 517 | + /** |
|
| 518 | + * @param string $html |
|
| 519 | + */ |
|
| 514 | 520 | function add_data_to_container( $html ) { |
| 515 | 521 | global $post; |
| 516 | 522 | if ( |
@@ -757,6 +763,9 @@ discard block |
||
| 757 | 763 | return ( 1 == $value ) ? 1 : 0; |
| 758 | 764 | } |
| 759 | 765 | |
| 766 | + /** |
|
| 767 | + * @param string $name |
|
| 768 | + */ |
|
| 760 | 769 | function settings_checkbox( $name, $label_text, $extra_text = '', $default_to_checked = true ) { |
| 761 | 770 | if ( empty( $name ) ) { |
| 762 | 771 | return; |
@@ -772,6 +781,9 @@ discard block |
||
| 772 | 781 | echo '</fieldset>'; |
| 773 | 782 | } |
| 774 | 783 | |
| 784 | + /** |
|
| 785 | + * @param string $name |
|
| 786 | + */ |
|
| 775 | 787 | function settings_select( $name, $values, $extra_text = '' ) { |
| 776 | 788 | if ( empty( $name ) || ! is_array( $values ) || empty( $values ) ) { |
| 777 | 789 | return; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | /** |
| 143 | 143 | * Plugin options getter |
| 144 | 144 | * |
| 145 | - * @param string|array $option Option name. |
|
| 145 | + * @param string $option Option name. |
|
| 146 | 146 | * @param mixed $default Default value. |
| 147 | 147 | * |
| 148 | 148 | * @return mixed Option value |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | * |
| 159 | 159 | * @param string $url Soundcloud URL. |
| 160 | 160 | * |
| 161 | - * @return boolean |
|
| 161 | + * @return integer |
|
| 162 | 162 | */ |
| 163 | 163 | function soundcloud_url_has_tracklist( $url ) { |
| 164 | 164 | return preg_match( '/^(.+?)\/(sets|groups|playlists)\/(.+?)$/', $url ); |
@@ -716,7 +716,7 @@ discard block |
||
| 716 | 716 | * This is ported over from the manage module, which has been deprecated and baked in here. |
| 717 | 717 | * |
| 718 | 718 | * @param $domains |
| 719 | - * @return array |
|
| 719 | + * @return string[] |
|
| 720 | 720 | */ |
| 721 | 721 | function allow_wpcom_domain( $domains ) { |
| 722 | 722 | if ( empty( $domains ) ) { |
@@ -1236,7 +1236,7 @@ discard block |
||
| 1236 | 1236 | } |
| 1237 | 1237 | /** |
| 1238 | 1238 | * Does the network allow admins to add new users. |
| 1239 | - * @return boolian |
|
| 1239 | + * @return boolean |
|
| 1240 | 1240 | */ |
| 1241 | 1241 | static function network_add_new_users( $option = null ) { |
| 1242 | 1242 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1341,7 +1341,7 @@ discard block |
||
| 1341 | 1341 | * database which could be set to anything as opposed to what this function returns. |
| 1342 | 1342 | * @param bool $option |
| 1343 | 1343 | * |
| 1344 | - * @return boolean |
|
| 1344 | + * @return string |
|
| 1345 | 1345 | */ |
| 1346 | 1346 | public function is_main_network_option( $option ) { |
| 1347 | 1347 | // return '1' or '' |
@@ -1352,7 +1352,7 @@ discard block |
||
| 1352 | 1352 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
| 1353 | 1353 | * |
| 1354 | 1354 | * @param string $option |
| 1355 | - * @return boolean |
|
| 1355 | + * @return string |
|
| 1356 | 1356 | */ |
| 1357 | 1357 | public function is_multisite( $option ) { |
| 1358 | 1358 | return (string) (bool) is_multisite(); |
@@ -1414,7 +1414,7 @@ discard block |
||
| 1414 | 1414 | |
| 1415 | 1415 | /** |
| 1416 | 1416 | * Returns true if the site has file write access false otherwise. |
| 1417 | - * @return string ( '1' | '0' ) |
|
| 1417 | + * @return integer ( '1' | '0' ) |
|
| 1418 | 1418 | **/ |
| 1419 | 1419 | public static function file_system_write_access() { |
| 1420 | 1420 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -2145,6 +2145,7 @@ discard block |
||
| 2145 | 2145 | * @param int $user_id |
| 2146 | 2146 | * @param string $token |
| 2147 | 2147 | * return bool |
| 2148 | + * @param boolean $is_master_user |
|
| 2148 | 2149 | */ |
| 2149 | 2150 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
| 2150 | 2151 | // not designed for concurrent updates |
@@ -2591,7 +2592,7 @@ discard block |
||
| 2591 | 2592 | * |
| 2592 | 2593 | * @param string $tag Tag as it appears in each module heading. |
| 2593 | 2594 | * |
| 2594 | - * @return mixed |
|
| 2595 | + * @return string |
|
| 2595 | 2596 | */ |
| 2596 | 2597 | public static function translate_module_tag( $tag ) { |
| 2597 | 2598 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2763,8 +2764,8 @@ discard block |
||
| 2763 | 2764 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
| 2764 | 2765 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
| 2765 | 2766 | * |
| 2766 | - * @param $string |
|
| 2767 | - * @return mixed |
|
| 2767 | + * @param string $string |
|
| 2768 | + * @return string|null |
|
| 2768 | 2769 | */ |
| 2769 | 2770 | public static function alias_directories( $string ) { |
| 2770 | 2771 | // ABSPATH has a trailing slash. |
@@ -3024,6 +3025,9 @@ discard block |
||
| 3024 | 3025 | return self::update_active_modules( $new ); |
| 3025 | 3026 | } |
| 3026 | 3027 | |
| 3028 | + /** |
|
| 3029 | + * @param string $module |
|
| 3030 | + */ |
|
| 3027 | 3031 | public static function enable_module_configurable( $module ) { |
| 3028 | 3032 | $module = Jetpack::get_module_slug( $module ); |
| 3029 | 3033 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -3052,6 +3056,9 @@ discard block |
||
| 3052 | 3056 | } |
| 3053 | 3057 | |
| 3054 | 3058 | /* Installation */ |
| 3059 | + /** |
|
| 3060 | + * @param string $message |
|
| 3061 | + */ |
|
| 3055 | 3062 | public static function bail_on_activation( $message, $deactivate = true ) { |
| 3056 | 3063 | ?> |
| 3057 | 3064 | <!doctype html> |
@@ -3786,7 +3793,7 @@ discard block |
||
| 3786 | 3793 | * Add help to the Jetpack page |
| 3787 | 3794 | * |
| 3788 | 3795 | * @since Jetpack (1.2.3) |
| 3789 | - * @return false if not the Jetpack page |
|
| 3796 | + * @return false|null if not the Jetpack page |
|
| 3790 | 3797 | */ |
| 3791 | 3798 | function admin_help() { |
| 3792 | 3799 | $current_screen = get_current_screen(); |
@@ -4605,6 +4612,9 @@ discard block |
||
| 4605 | 4612 | return $url; |
| 4606 | 4613 | } |
| 4607 | 4614 | |
| 4615 | + /** |
|
| 4616 | + * @return string |
|
| 4617 | + */ |
|
| 4608 | 4618 | public static function nonce_url_no_esc( $actionurl, $action = -1, $name = '_wpnonce' ) { |
| 4609 | 4619 | $actionurl = str_replace( '&', '&', $actionurl ); |
| 4610 | 4620 | return add_query_arg( $name, wp_create_nonce( $action ), $actionurl ); |
@@ -4664,6 +4674,7 @@ discard block |
||
| 4664 | 4674 | /** |
| 4665 | 4675 | * Returns the requested Jetpack API URL |
| 4666 | 4676 | * |
| 4677 | + * @param string $relative_url |
|
| 4667 | 4678 | * @return string |
| 4668 | 4679 | */ |
| 4669 | 4680 | public static function api_url( $relative_url ) { |
@@ -4855,6 +4866,7 @@ discard block |
||
| 4855 | 4866 | * Note these tokens are unique per call, NOT static per site for connecting. |
| 4856 | 4867 | * |
| 4857 | 4868 | * @since 2.6 |
| 4869 | + * @param string $action |
|
| 4858 | 4870 | * @return array |
| 4859 | 4871 | */ |
| 4860 | 4872 | public static function generate_secrets( $action, $user_id = false, $exp = 600 ) { |
@@ -5389,7 +5401,6 @@ discard block |
||
| 5389 | 5401 | /** |
| 5390 | 5402 | * Report authentication status to the WP REST API. |
| 5391 | 5403 | * |
| 5392 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
| 5393 | 5404 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
| 5394 | 5405 | */ |
| 5395 | 5406 | public function wp_rest_authentication_errors( $value ) { |
@@ -5399,6 +5410,10 @@ discard block |
||
| 5399 | 5410 | return $this->rest_authentication_status; |
| 5400 | 5411 | } |
| 5401 | 5412 | |
| 5413 | + /** |
|
| 5414 | + * @param integer $timestamp |
|
| 5415 | + * @param string $nonce |
|
| 5416 | + */ |
|
| 5402 | 5417 | function add_nonce( $timestamp, $nonce ) { |
| 5403 | 5418 | global $wpdb; |
| 5404 | 5419 | static $nonces_used_this_request = array(); |
@@ -5544,6 +5559,7 @@ discard block |
||
| 5544 | 5559 | * @param string $key |
| 5545 | 5560 | * @param string $value |
| 5546 | 5561 | * @param bool $restate private |
| 5562 | + * @return string |
|
| 5547 | 5563 | */ |
| 5548 | 5564 | public static function state( $key = null, $value = null, $restate = false ) { |
| 5549 | 5565 | static $state = array(); |
@@ -5600,6 +5616,9 @@ discard block |
||
| 5600 | 5616 | Jetpack::state( null, null, true ); |
| 5601 | 5617 | } |
| 5602 | 5618 | |
| 5619 | + /** |
|
| 5620 | + * @param string $file |
|
| 5621 | + */ |
|
| 5603 | 5622 | public static function check_privacy( $file ) { |
| 5604 | 5623 | static $is_site_publicly_accessible = null; |
| 5605 | 5624 | |
@@ -5682,6 +5701,9 @@ discard block |
||
| 5682 | 5701 | } |
| 5683 | 5702 | } |
| 5684 | 5703 | |
| 5704 | + /** |
|
| 5705 | + * @param string $url |
|
| 5706 | + */ |
|
| 5685 | 5707 | public static function staticize_subdomain( $url ) { |
| 5686 | 5708 | |
| 5687 | 5709 | // Extract hostname from URL |
@@ -6232,9 +6254,7 @@ discard block |
||
| 6232 | 6254 | * |
| 6233 | 6255 | * Attached to `style_loader_src` filter. |
| 6234 | 6256 | * |
| 6235 | - * @param string $tag The tag that would link to the external asset. |
|
| 6236 | 6257 | * @param string $handle The registered handle of the script in question. |
| 6237 | - * @param string $href The url of the asset in question. |
|
| 6238 | 6258 | */ |
| 6239 | 6259 | public static function set_suffix_on_min( $src, $handle ) { |
| 6240 | 6260 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6422,8 +6442,8 @@ discard block |
||
| 6422 | 6442 | * - Absolute URLs `http://domain.com/feh.png` |
| 6423 | 6443 | * - Domain root relative URLs `/feh.png` |
| 6424 | 6444 | * |
| 6425 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
| 6426 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 6445 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
| 6446 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 6427 | 6447 | * |
| 6428 | 6448 | * @return mixed|string |
| 6429 | 6449 | */ |
@@ -6666,7 +6686,7 @@ discard block |
||
| 6666 | 6686 | /** |
| 6667 | 6687 | * Stores and prints out domains to prefetch for page speed optimization. |
| 6668 | 6688 | * |
| 6669 | - * @param mixed $new_urls |
|
| 6689 | + * @param string[] $new_urls |
|
| 6670 | 6690 | */ |
| 6671 | 6691 | public static function dns_prefetch( $new_urls = null ) { |
| 6672 | 6692 | static $prefetch_urls = array(); |
@@ -6721,7 +6741,6 @@ discard block |
||
| 6721 | 6741 | } |
| 6722 | 6742 | |
| 6723 | 6743 | /** |
| 6724 | - * @param mixed $result Value for the user's option |
|
| 6725 | 6744 | * @return mixed |
| 6726 | 6745 | */ |
| 6727 | 6746 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | * @param string $vendorPath Path to the vendor directory. |
| 141 | 141 | * @param string $basePath Base Path. |
| 142 | 142 | * |
| 143 | - * @return array $classMap |
|
| 143 | + * @return string $classMap |
|
| 144 | 144 | */ |
| 145 | 145 | private function getClassMap( array $autoloads, Filesystem $filesystem, $vendorPath, $basePath ) { |
| 146 | 146 | $blacklist = null; // not supported for now. |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | /** |
| 179 | 179 | * Generate the PHP that will be used in the autoload_classmap_package.php files. |
| 180 | 180 | * |
| 181 | - * @param srting $classMap class map array string that is to be written out to the file. |
|
| 181 | + * @param string $classMap class map array string that is to be written out to the file. |
|
| 182 | 182 | * |
| 183 | 183 | * @return string |
| 184 | 184 | */ |