@@ -882,7 +882,7 @@ discard block |
||
882 | 882 | } |
883 | 883 | /** |
884 | 884 | * Does the network allow admins to add new users. |
885 | - * @return boolian |
|
885 | + * @return boolean |
|
886 | 886 | */ |
887 | 887 | static function network_add_new_users( $option = null ) { |
888 | 888 | return (bool) get_site_option( 'add_new_users' ); |
@@ -987,7 +987,7 @@ discard block |
||
987 | 987 | * database which could be set to anything as opposed to what this function returns. |
988 | 988 | * @param bool $option |
989 | 989 | * |
990 | - * @return boolean |
|
990 | + * @return string |
|
991 | 991 | */ |
992 | 992 | public function is_main_network_option( $option ) { |
993 | 993 | // return '1' or '' |
@@ -998,7 +998,7 @@ discard block |
||
998 | 998 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
999 | 999 | * |
1000 | 1000 | * @param string $option |
1001 | - * @return boolean |
|
1001 | + * @return string |
|
1002 | 1002 | */ |
1003 | 1003 | public function is_multisite( $option ) { |
1004 | 1004 | return (string) (bool) is_multisite(); |
@@ -1060,7 +1060,7 @@ discard block |
||
1060 | 1060 | |
1061 | 1061 | /** |
1062 | 1062 | * Returns true if the site has file write access false otherwise. |
1063 | - * @return string ( '1' | '0' ) |
|
1063 | + * @return integer ( '1' | '0' ) |
|
1064 | 1064 | **/ |
1065 | 1065 | public static function file_system_write_access() { |
1066 | 1066 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -1247,6 +1247,7 @@ discard block |
||
1247 | 1247 | * @access public |
1248 | 1248 | * @static |
1249 | 1249 | * |
1250 | + * @param string $feature |
|
1250 | 1251 | * @return bool True if plan supports feature, false if not |
1251 | 1252 | */ |
1252 | 1253 | public static function active_plan_supports( $feature ) { |
@@ -1736,7 +1737,7 @@ discard block |
||
1736 | 1737 | * Returns the requested option. Looks in jetpack_options or jetpack_$name as appropriate. |
1737 | 1738 | * |
1738 | 1739 | * @param string $name Option name |
1739 | - * @param mixed $default (optional) |
|
1740 | + * @param boolean $default (optional) |
|
1740 | 1741 | */ |
1741 | 1742 | public static function get_option( $name, $default = false ) { |
1742 | 1743 | return Jetpack_Options::get_option( $name, $default ); |
@@ -1746,6 +1747,7 @@ discard block |
||
1746 | 1747 | * Stores two secrets and a timestamp so WordPress.com can make a request back and verify an action |
1747 | 1748 | * Does some extra verification so urls (such as those to public-api, register, etc) can't just be crafted |
1748 | 1749 | * $name must be a registered option name. |
1750 | + * @param string $name |
|
1749 | 1751 | */ |
1750 | 1752 | public static function create_nonce( $name ) { |
1751 | 1753 | $secret = wp_generate_password( 32, false ) . ':' . wp_generate_password( 32, false ) . ':' . ( time() + 600 ); |
@@ -1803,6 +1805,7 @@ discard block |
||
1803 | 1805 | * @param int $user_id |
1804 | 1806 | * @param string $token |
1805 | 1807 | * return bool |
1808 | + * @param boolean $is_master_user |
|
1806 | 1809 | */ |
1807 | 1810 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
1808 | 1811 | // not designed for concurrent updates |
@@ -2197,6 +2200,7 @@ discard block |
||
2197 | 2200 | |
2198 | 2201 | /** |
2199 | 2202 | * Like core's get_file_data implementation, but caches the result. |
2203 | + * @param string $file |
|
2200 | 2204 | */ |
2201 | 2205 | public static function get_file_data( $file, $headers ) { |
2202 | 2206 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2225,7 +2229,7 @@ discard block |
||
2225 | 2229 | * |
2226 | 2230 | * @param string $tag Tag as it appears in each module heading. |
2227 | 2231 | * |
2228 | - * @return mixed |
|
2232 | + * @return string |
|
2229 | 2233 | */ |
2230 | 2234 | public static function translate_module_tag( $tag ) { |
2231 | 2235 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2238,7 +2242,7 @@ discard block |
||
2238 | 2242 | * |
2239 | 2243 | * @param array $modules |
2240 | 2244 | * |
2241 | - * @return string|void |
|
2245 | + * @return string |
|
2242 | 2246 | */ |
2243 | 2247 | public static function get_translated_modules( $modules ) { |
2244 | 2248 | foreach ( $modules as $index => $module ) { |
@@ -2539,6 +2543,9 @@ discard block |
||
2539 | 2543 | _deprecated_function( __METHOD__, 'jeptack-4.2' ); |
2540 | 2544 | } |
2541 | 2545 | |
2546 | + /** |
|
2547 | + * @return string |
|
2548 | + */ |
|
2542 | 2549 | public static function deactivate_module( $module ) { |
2543 | 2550 | /** |
2544 | 2551 | * Fires when a module is deactivated. |
@@ -2567,6 +2574,9 @@ discard block |
||
2567 | 2574 | return self::update_active_modules( $new ); |
2568 | 2575 | } |
2569 | 2576 | |
2577 | + /** |
|
2578 | + * @param string $module |
|
2579 | + */ |
|
2570 | 2580 | public static function enable_module_configurable( $module ) { |
2571 | 2581 | $module = Jetpack::get_module_slug( $module ); |
2572 | 2582 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -2577,21 +2587,33 @@ discard block |
||
2577 | 2587 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
2578 | 2588 | } |
2579 | 2589 | |
2590 | + /** |
|
2591 | + * @param string $module |
|
2592 | + */ |
|
2580 | 2593 | public static function module_configuration_load( $module, $method ) { |
2581 | 2594 | $module = Jetpack::get_module_slug( $module ); |
2582 | 2595 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
2583 | 2596 | } |
2584 | 2597 | |
2598 | + /** |
|
2599 | + * @param string $module |
|
2600 | + */ |
|
2585 | 2601 | public static function module_configuration_head( $module, $method ) { |
2586 | 2602 | $module = Jetpack::get_module_slug( $module ); |
2587 | 2603 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
2588 | 2604 | } |
2589 | 2605 | |
2606 | + /** |
|
2607 | + * @param string $module |
|
2608 | + */ |
|
2590 | 2609 | public static function module_configuration_screen( $module, $method ) { |
2591 | 2610 | $module = Jetpack::get_module_slug( $module ); |
2592 | 2611 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
2593 | 2612 | } |
2594 | 2613 | |
2614 | + /** |
|
2615 | + * @param string $module |
|
2616 | + */ |
|
2595 | 2617 | public static function module_configuration_activation_screen( $module, $method ) { |
2596 | 2618 | $module = Jetpack::get_module_slug( $module ); |
2597 | 2619 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -2599,6 +2621,9 @@ discard block |
||
2599 | 2621 | |
2600 | 2622 | /* Installation */ |
2601 | 2623 | |
2624 | + /** |
|
2625 | + * @param string $message |
|
2626 | + */ |
|
2602 | 2627 | public static function bail_on_activation( $message, $deactivate = true ) { |
2603 | 2628 | ?> |
2604 | 2629 | <!doctype html> |
@@ -3245,7 +3270,7 @@ discard block |
||
3245 | 3270 | * Add help to the Jetpack page |
3246 | 3271 | * |
3247 | 3272 | * @since Jetpack (1.2.3) |
3248 | - * @return false if not the Jetpack page |
|
3273 | + * @return false|null if not the Jetpack page |
|
3249 | 3274 | */ |
3250 | 3275 | function admin_help() { |
3251 | 3276 | $current_screen = get_current_screen(); |
@@ -4243,6 +4268,7 @@ discard block |
||
4243 | 4268 | /** |
4244 | 4269 | * Returns the requested Jetpack API URL |
4245 | 4270 | * |
4271 | + * @param string $relative_url |
|
4246 | 4272 | * @return string |
4247 | 4273 | */ |
4248 | 4274 | public static function api_url( $relative_url ) { |
@@ -4387,7 +4413,8 @@ discard block |
||
4387 | 4413 | * Note these tokens are unique per call, NOT static per site for connecting. |
4388 | 4414 | * |
4389 | 4415 | * @since 2.6 |
4390 | - * @return array |
|
4416 | + * @param string $action |
|
4417 | + * @return string |
|
4391 | 4418 | */ |
4392 | 4419 | public function generate_secrets( $action, $exp = 600 ) { |
4393 | 4420 | $secret = wp_generate_password( 32, false ) // secret_1 |
@@ -4713,6 +4740,10 @@ discard block |
||
4713 | 4740 | return new WP_User( $token_details['user_id'] ); |
4714 | 4741 | } |
4715 | 4742 | |
4743 | + /** |
|
4744 | + * @param integer $timestamp |
|
4745 | + * @param string $nonce |
|
4746 | + */ |
|
4716 | 4747 | function add_nonce( $timestamp, $nonce ) { |
4717 | 4748 | global $wpdb; |
4718 | 4749 | static $nonces_used_this_request = array(); |
@@ -4858,6 +4889,7 @@ discard block |
||
4858 | 4889 | * @param string $key |
4859 | 4890 | * @param string $value |
4860 | 4891 | * @param bool $restate private |
4892 | + * @return string |
|
4861 | 4893 | */ |
4862 | 4894 | public static function state( $key = null, $value = null, $restate = false ) { |
4863 | 4895 | static $state = array(); |
@@ -4914,6 +4946,9 @@ discard block |
||
4914 | 4946 | Jetpack::state( null, null, true ); |
4915 | 4947 | } |
4916 | 4948 | |
4949 | + /** |
|
4950 | + * @param string $file |
|
4951 | + */ |
|
4917 | 4952 | public static function check_privacy( $file ) { |
4918 | 4953 | static $is_site_publicly_accessible = null; |
4919 | 4954 | |
@@ -5658,8 +5693,8 @@ discard block |
||
5658 | 5693 | * - Absolute URLs `http://domain.com/feh.png` |
5659 | 5694 | * - Domain root relative URLs `/feh.png` |
5660 | 5695 | * |
5661 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
5662 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
5696 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
5697 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
5663 | 5698 | * |
5664 | 5699 | * @return mixed|string |
5665 | 5700 | */ |
@@ -5950,7 +5985,7 @@ discard block |
||
5950 | 5985 | * |
5951 | 5986 | * @param string $option_name |
5952 | 5987 | * |
5953 | - * @return bool |
|
5988 | + * @return false|null |
|
5954 | 5989 | */ |
5955 | 5990 | public static function jumpstart_has_updated_module_option( $option_name = '' ) { |
5956 | 5991 | // Bail if Jump Start has already been dismissed |
@@ -6041,7 +6076,6 @@ discard block |
||
6041 | 6076 | } |
6042 | 6077 | |
6043 | 6078 | /** |
6044 | - * @param mixed $result Value for the user's option |
|
6045 | 6079 | * @return mixed |
6046 | 6080 | */ |
6047 | 6081 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -85,7 +85,7 @@ |
||
85 | 85 | * |
86 | 86 | * @param string $cron_name |
87 | 87 | * |
88 | - * @return bool |
|
88 | + * @return false|null |
|
89 | 89 | */ |
90 | 90 | public function activate_cron( $cron_name ) { |
91 | 91 |
@@ -273,6 +273,9 @@ discard block |
||
273 | 273 | } |
274 | 274 | } |
275 | 275 | |
276 | + /** |
|
277 | + * @param stdClass $block |
|
278 | + */ |
|
276 | 279 | protected function flattenSelectors($block, $parentKey = null) { |
277 | 280 | if ($block->selectors) { |
278 | 281 | $selectors = array(); |
@@ -362,6 +365,10 @@ discard block |
||
362 | 365 | } |
363 | 366 | |
364 | 367 | // TODO refactor compileNestedBlock and compileMedia into same thing |
368 | + |
|
369 | + /** |
|
370 | + * @param string[] $selectors |
|
371 | + */ |
|
365 | 372 | protected function compileNestedBlock($block, $selectors) { |
366 | 373 | $this->pushEnv($block); |
367 | 374 | |
@@ -1140,6 +1147,9 @@ discard block |
||
1140 | 1147 | return $this->toBool($left[1] < $right[1]); |
1141 | 1148 | } |
1142 | 1149 | |
1150 | + /** |
|
1151 | + * @param boolean $thing |
|
1152 | + */ |
|
1143 | 1153 | public function toBool($thing) { |
1144 | 1154 | return $thing ? self::$true : self::$false; |
1145 | 1155 | } |
@@ -1268,6 +1278,10 @@ discard block |
||
1268 | 1278 | } |
1269 | 1279 | |
1270 | 1280 | // find the final set of selectors |
1281 | + |
|
1282 | + /** |
|
1283 | + * @param stdClass $env |
|
1284 | + */ |
|
1271 | 1285 | protected function multiplySelectors($env) { |
1272 | 1286 | $envs = array(); |
1273 | 1287 | while (null !== $env) { |
@@ -1474,6 +1488,9 @@ discard block |
||
1474 | 1488 | $env->store[$name] = $value; |
1475 | 1489 | } |
1476 | 1490 | |
1491 | + /** |
|
1492 | + * @param boolean $defaultValue |
|
1493 | + */ |
|
1477 | 1494 | public function get($name, $defaultValue = null, $env = null) { |
1478 | 1495 | $name = $this->normalizeName($name); |
1479 | 1496 | |
@@ -1503,6 +1520,9 @@ discard block |
||
1503 | 1520 | $this->importPaths[] = $path; |
1504 | 1521 | } |
1505 | 1522 | |
1523 | + /** |
|
1524 | + * @param string $path |
|
1525 | + */ |
|
1506 | 1526 | public function setImportPaths($path) { |
1507 | 1527 | $this->importPaths = (array)$path; |
1508 | 1528 | } |
@@ -1511,6 +1531,9 @@ discard block |
||
1511 | 1531 | $this->numberPrecision = $numberPrecision; |
1512 | 1532 | } |
1513 | 1533 | |
1534 | + /** |
|
1535 | + * @param string $formatterName |
|
1536 | + */ |
|
1514 | 1537 | public function setFormatter($formatterName) { |
1515 | 1538 | $this->formatter = $formatterName; |
1516 | 1539 | } |
@@ -1544,6 +1567,10 @@ discard block |
||
1544 | 1567 | } |
1545 | 1568 | |
1546 | 1569 | // results the file path for an import url if it exists |
1570 | + |
|
1571 | + /** |
|
1572 | + * @param string $url |
|
1573 | + */ |
|
1547 | 1574 | public function findImport($url) { |
1548 | 1575 | $urls = array(); |
1549 | 1576 | |
@@ -1579,6 +1606,9 @@ discard block |
||
1579 | 1606 | return null; |
1580 | 1607 | } |
1581 | 1608 | |
1609 | + /** |
|
1610 | + * @param string $name |
|
1611 | + */ |
|
1582 | 1612 | protected function fileExists($name) { |
1583 | 1613 | return is_file($name); |
1584 | 1614 | } |
@@ -1766,6 +1796,11 @@ discard block |
||
1766 | 1796 | return array('hsl', fmod($h, 360), $s * 100, $l * 100); |
1767 | 1797 | } |
1768 | 1798 | |
1799 | + /** |
|
1800 | + * @param double $m1 |
|
1801 | + * @param double $m2 |
|
1802 | + * @param double $h |
|
1803 | + */ |
|
1769 | 1804 | public function hueToRGB($m1, $m2, $h) { |
1770 | 1805 | if ($h < 0) |
1771 | 1806 | $h += 1; |
@@ -1850,6 +1885,10 @@ discard block |
||
1850 | 1885 | } |
1851 | 1886 | |
1852 | 1887 | // helper function for adjust_color, change_color, and scale_color |
1888 | + |
|
1889 | + /** |
|
1890 | + * @param string $fn |
|
1891 | + */ |
|
1853 | 1892 | protected function alter_color($args, $fn) { |
1854 | 1893 | $color = $this->assertColor($args[0]); |
1855 | 1894 | |
@@ -2047,6 +2086,9 @@ discard block |
||
2047 | 2086 | return array("number", $hsl[3], "%"); |
2048 | 2087 | } |
2049 | 2088 | |
2089 | + /** |
|
2090 | + * @param integer $idx |
|
2091 | + */ |
|
2050 | 2092 | protected function adjustHsl($color, $idx, $amount) { |
2051 | 2093 | $hsl = $this->toHSL($color[1], $color[2], $color[3]); |
2052 | 2094 | $hsl[$idx] += $amount; |
@@ -2965,6 +3007,10 @@ discard block |
||
2965 | 3007 | return false; |
2966 | 3008 | } |
2967 | 3009 | |
3010 | + /** |
|
3011 | + * @param string $what |
|
3012 | + * @param boolean $eatWhitespace |
|
3013 | + */ |
|
2968 | 3014 | protected function literal($what, $eatWhitespace = null) { |
2969 | 3015 | if (is_null($eatWhitespace)) $eatWhitespace = $this->eatWhiteDefault; |
2970 | 3016 | |
@@ -2997,6 +3043,9 @@ discard block |
||
2997 | 3043 | return $b; |
2998 | 3044 | } |
2999 | 3045 | |
3046 | + /** |
|
3047 | + * @param string $type |
|
3048 | + */ |
|
3000 | 3049 | protected function pushSpecialBlock($type) { |
3001 | 3050 | $block = $this->pushBlock(null); |
3002 | 3051 | $block->type = $type; |
@@ -3123,6 +3172,9 @@ discard block |
||
3123 | 3172 | return $this->genericList($out, "expression"); |
3124 | 3173 | } |
3125 | 3174 | |
3175 | + /** |
|
3176 | + * @param string $parseItem |
|
3177 | + */ |
|
3126 | 3178 | protected function genericList(&$out, $parseItem, $delim="", $flatten=true) { |
3127 | 3179 | $s = $this->seek(); |
3128 | 3180 | $items = array(); |
@@ -3171,6 +3223,9 @@ discard block |
||
3171 | 3223 | return false; |
3172 | 3224 | } |
3173 | 3225 | |
3226 | + /** |
|
3227 | + * @param integer $minP |
|
3228 | + */ |
|
3174 | 3229 | protected function expHelper($lhs, $minP) { |
3175 | 3230 | $opstr = self::$operatorStr; |
3176 | 3231 | |
@@ -3518,6 +3573,11 @@ discard block |
||
3518 | 3573 | } |
3519 | 3574 | |
3520 | 3575 | // an unbounded string stopped by $end |
3576 | + |
|
3577 | + /** |
|
3578 | + * @param string $end |
|
3579 | + * @param string $nestingOpen |
|
3580 | + */ |
|
3521 | 3581 | protected function openString($end, &$out, $nestingOpen=null) { |
3522 | 3582 | $oldWhite = $this->eatWhiteDefault; |
3523 | 3583 | $this->eatWhiteDefault = false; |
@@ -3850,6 +3910,9 @@ discard block |
||
3850 | 3910 | return false; |
3851 | 3911 | } |
3852 | 3912 | |
3913 | + /** |
|
3914 | + * @param boolean $eatWhitespace |
|
3915 | + */ |
|
3853 | 3916 | protected function keyword(&$word, $eatWhitespace = null) { |
3854 | 3917 | if ($this->match('([\w_\-\*!"\'\\\\][\w\-_"\'\\\\]*)', |
3855 | 3918 | $m, $eatWhitespace)) |
@@ -3959,6 +4022,10 @@ discard block |
||
3959 | 4022 | } |
3960 | 4023 | |
3961 | 4024 | // try to match something on head of buffer |
4025 | + |
|
4026 | + /** |
|
4027 | + * @param string $regex |
|
4028 | + */ |
|
3962 | 4029 | protected function match($regex, &$out, $eatWhitespace = null) { |
3963 | 4030 | if (is_null($eatWhitespace)) $eatWhitespace = $this->eatWhiteDefault; |
3964 | 4031 | |
@@ -3987,6 +4054,9 @@ discard block |
||
3987 | 4054 | return $gotWhite; |
3988 | 4055 | } |
3989 | 4056 | |
4057 | + /** |
|
4058 | + * @param string $regex |
|
4059 | + */ |
|
3990 | 4060 | protected function peek($regex, &$out, $from=null) { |
3991 | 4061 | if (is_null($from)) $from = $this->count; |
3992 | 4062 | |
@@ -4253,6 +4323,7 @@ discard block |
||
4253 | 4323 | /** |
4254 | 4324 | * Get path to cached .css file |
4255 | 4325 | * |
4326 | + * @param string $fname |
|
4256 | 4327 | * @return string |
4257 | 4328 | */ |
4258 | 4329 | protected function cacheName($fname) { |
@@ -4262,6 +4333,7 @@ discard block |
||
4262 | 4333 | /** |
4263 | 4334 | * Get path to cached imports |
4264 | 4335 | * |
4336 | + * @param string $out |
|
4265 | 4337 | * @return string |
4266 | 4338 | */ |
4267 | 4339 | protected function importsCacheName($out) { |