@@ -149,6 +149,9 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | /** |
| 151 | 151 | * Helper function for Jetpack_Color::fromHsl() |
| 152 | + * @param double $p |
|
| 153 | + * @param double $q |
|
| 154 | + * @param integer $t |
|
| 152 | 155 | */ |
| 153 | 156 | private function hue2rgb( $p, $q, $t ) { |
| 154 | 157 | if ( $t < 0 ) $t += 1; |
@@ -278,7 +281,7 @@ discard block |
||
| 278 | 281 | * Get HSV values for color |
| 279 | 282 | * (integer values from 0-255, fast but less accurate) |
| 280 | 283 | * |
| 281 | - * @return int |
|
| 284 | + * @return string |
|
| 282 | 285 | */ |
| 283 | 286 | public function toHsvInt() |
| 284 | 287 | { |
@@ -498,7 +501,7 @@ discard block |
||
| 498 | 501 | * |
| 499 | 502 | * @param Jetpack_Color $color |
| 500 | 503 | * |
| 501 | - * @return int |
|
| 504 | + * @return double |
|
| 502 | 505 | */ |
| 503 | 506 | public function getDistanceRgbFrom(Jetpack_Color $color) |
| 504 | 507 | { |
@@ -682,6 +685,9 @@ discard block |
||
| 682 | 685 | return $this->incrementLightness( $amount ); |
| 683 | 686 | } |
| 684 | 687 | |
| 688 | + /** |
|
| 689 | + * @param integer $amount |
|
| 690 | + */ |
|
| 685 | 691 | public function incrementLightness( $amount ) { |
| 686 | 692 | $hsl = $this->toHsl(); |
| 687 | 693 | extract( $hsl ); |
@@ -699,6 +705,9 @@ discard block |
||
| 699 | 705 | return $this->incrementSaturation( - $amount ); |
| 700 | 706 | } |
| 701 | 707 | |
| 708 | + /** |
|
| 709 | + * @param integer $amount |
|
| 710 | + */ |
|
| 702 | 711 | public function incrementSaturation( $amount ) { |
| 703 | 712 | $hsl = $this->toHsl(); |
| 704 | 713 | extract( $hsl ); |
@@ -739,6 +748,9 @@ discard block |
||
| 739 | 748 | return $this->incrementHue( $incr ); |
| 740 | 749 | } |
| 741 | 750 | |
| 751 | + /** |
|
| 752 | + * @param integer $amount |
|
| 753 | + */ |
|
| 742 | 754 | public function incrementHue( $amount ) { |
| 743 | 755 | $hsl = $this->toHsl(); |
| 744 | 756 | extract( $hsl ); |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | * NOTE: If you want IMAGES, call extract( $blog_id, $post_id, ...) which will give you more/better image extraction |
| 75 | 75 | * This method will give you an error if you ask for IMAGES. |
| 76 | 76 | * |
| 77 | - * @param $content The HTML post_content of a post |
|
| 77 | + * @param string $content The HTML post_content of a post |
|
| 78 | 78 | * @param $what_to_extract (int) A mask of things to extract, e.g. Jetpack_Media_Meta_Extractor::IMAGES | Jetpack_Media_Meta_Extractor::MENTIONS |
| 79 | 79 | * @param $already_extracted (array) Previously extracted things, e.g. images from extract(), which can be used for x-referencing here |
| 80 | 80 | * @returns a structure containing metadata about the embedded things, or empty array if nothing found, or WP_Error on error |
@@ -1341,6 +1341,7 @@ discard block |
||
| 1341 | 1341 | * timezone set in the options table for the blog or the GMT offset. |
| 1342 | 1342 | * |
| 1343 | 1343 | * @param datetime string |
| 1344 | + * @param string $date_string |
|
| 1344 | 1345 | * |
| 1345 | 1346 | * @return array( $local_time_string, $gmt_time_string ) |
| 1346 | 1347 | */ |
@@ -1458,6 +1459,10 @@ discard block |
||
| 1458 | 1459 | do_action( 'restapi_theme_init' ); |
| 1459 | 1460 | } |
| 1460 | 1461 | |
| 1462 | + /** |
|
| 1463 | + * @param string $from_hook |
|
| 1464 | + * @param string $to_hook |
|
| 1465 | + */ |
|
| 1461 | 1466 | function copy_hooks( $from_hook, $to_hook, $base_paths ) { |
| 1462 | 1467 | global $wp_filter; |
| 1463 | 1468 | foreach ( $wp_filter as $hook => $actions ) { |
@@ -16,6 +16,9 @@ discard block |
||
| 16 | 16 | public $context; |
| 17 | 17 | public $site; |
| 18 | 18 | |
| 19 | + /** |
|
| 20 | + * @param Jetpack_Site $site |
|
| 21 | + */ |
|
| 19 | 22 | function __construct( $site, $post, $context ) { |
| 20 | 23 | $this->post = $post; |
| 21 | 24 | $this->context = $context; |
@@ -508,6 +511,9 @@ discard block |
||
| 508 | 511 | return $suggestions; |
| 509 | 512 | } |
| 510 | 513 | |
| 514 | + /** |
|
| 515 | + * @param string $context |
|
| 516 | + */ |
|
| 511 | 517 | private function format_taxonomy( $taxonomy, $taxonomy_type, $context ) { |
| 512 | 518 | // Permissions |
| 513 | 519 | switch ( $context ) { |
@@ -699,8 +699,7 @@ discard block |
||
| 699 | 699 | * Render the events |
| 700 | 700 | * |
| 701 | 701 | * @param string $url (default: '') |
| 702 | - * @param string $context (default: 'widget') or 'shortcode' |
|
| 703 | - * @return mixed bool|string false on failure, rendered HTML string on success. |
|
| 702 | + * @return false|string bool|string false on failure, rendered HTML string on success. |
|
| 704 | 703 | */ |
| 705 | 704 | public function render( $url = '', $args = array() ) { |
| 706 | 705 | |
@@ -857,8 +856,7 @@ discard block |
||
| 857 | 856 | * Wrapper function for iCalendarReader->render() |
| 858 | 857 | * |
| 859 | 858 | * @param string $url (default: '') |
| 860 | - * @param string $context (default: 'widget') or 'shortcode' |
|
| 861 | - * @return mixed bool|string false on failure, rendered HTML string on success. |
|
| 859 | + * @return false|string bool|string false on failure, rendered HTML string on success. |
|
| 862 | 860 | */ |
| 863 | 861 | function icalendar_render_events( $url = '', $args = array() ) { |
| 864 | 862 | $ical = new iCalendarReader(); |
@@ -93,14 +93,24 @@ |
||
| 93 | 93 | * So that we can test. |
| 94 | 94 | */ |
| 95 | 95 | |
| 96 | + /** |
|
| 97 | + * @param string $class |
|
| 98 | + * @param string $method |
|
| 99 | + */ |
|
| 96 | 100 | public function method_exists( $class, $method ) { |
| 97 | 101 | return method_exists( $class, $method ); |
| 98 | 102 | } |
| 99 | 103 | |
| 104 | + /** |
|
| 105 | + * @param string $class |
|
| 106 | + */ |
|
| 100 | 107 | public function class_exists( $class ) { |
| 101 | 108 | return class_exists( $class ); |
| 102 | 109 | } |
| 103 | 110 | |
| 111 | + /** |
|
| 112 | + * @param string $function |
|
| 113 | + */ |
|
| 104 | 114 | public function function_exists( $function ) { |
| 105 | 115 | return function_exists( $function ); |
| 106 | 116 | } |
@@ -163,7 +163,7 @@ |
||
| 163 | 163 | /** |
| 164 | 164 | * Iterates through expected items ( plugins or themes ) and compares them to actual results. |
| 165 | 165 | * |
| 166 | - * @param $items 'plugin' or 'theme' |
|
| 166 | + * @param string $items 'plugin' or 'theme' |
|
| 167 | 167 | */ |
| 168 | 168 | private function log_items( $items ) { |
| 169 | 169 | if ( ! isset( $this->expected[ $items ] ) ) { |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | /** |
| 88 | 88 | * Return an array of allowed mime_type items used to upload a media file. |
| 89 | 89 | * |
| 90 | - * @return array mime_type array |
|
| 90 | + * @return string[] mime_type array |
|
| 91 | 91 | */ |
| 92 | 92 | static function get_allowed_mime_types( $default_mime_types ) { |
| 93 | 93 | return array_unique( array_merge( $default_mime_types, array( |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | * @param object $media_item - media post object |
| 255 | 255 | * @param file $file - file recently added |
| 256 | 256 | * @param bool $has_original_media - condition is the original media has been already added |
| 257 | - * @return bool `true` if the item has been added. Otherwise `false`. |
|
| 257 | + * @return false|null `true` if the item has been added. Otherwise `false`. |
|
| 258 | 258 | */ |
| 259 | 259 | public static function register_revision( $media_item, $file, $has_original_media ) { |
| 260 | 260 | if ( is_wp_error( $file ) || ! $has_original_media ) { |
@@ -282,6 +282,9 @@ discard block |
||
| 282 | 282 | return $original; |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | + /** |
|
| 286 | + * @param string $pathname |
|
| 287 | + */ |
|
| 285 | 288 | public static function delete_file( $pathname ) { |
| 286 | 289 | if ( ! file_exists( $pathname ) || ! is_file( $pathname ) ) { |
| 287 | 290 | // let's touch a fake file to try to `really` remove the media file |
@@ -297,7 +300,7 @@ discard block |
||
| 297 | 300 | * |
| 298 | 301 | * @param number $media_id - media post ID |
| 299 | 302 | * @param string $filename - basename of the file ( name-of-file.ext ) |
| 300 | - * @return bool `true` is the file has been removed, `false` if not. |
|
| 303 | + * @return boolean|null `true` is the file has been removed, `false` if not. |
|
| 301 | 304 | */ |
| 302 | 305 | private static function delete_media_history_file( $media_id, $filename ) { |
| 303 | 306 | $attached_path = get_attached_file( $media_id ); |
@@ -29,7 +29,6 @@ discard block |
||
| 29 | 29 | * |
| 30 | 30 | * Used to construct meta links in API responses |
| 31 | 31 | * |
| 32 | - * @param mixed $args Optional arguments to be appended to URL |
|
| 33 | 32 | * @return string Endpoint URL |
| 34 | 33 | **/ |
| 35 | 34 | function get_link() { |
@@ -129,7 +128,7 @@ discard block |
||
| 129 | 128 | * This method is used in get_link() to construct meta links for API responses. |
| 130 | 129 | * |
| 131 | 130 | * @param $template_path string The generic endpoint path, e.g. /sites/%s |
| 132 | - * @param $path string The current endpoint path, relative to the version, e.g. /sites/12345 |
|
| 131 | + * @param string $path string The current endpoint path, relative to the version, e.g. /sites/12345 |
|
| 133 | 132 | * @param $request_method string Request method used to access the endpoint path |
| 134 | 133 | * @return string The current version, or otherwise the maximum version available |
| 135 | 134 | */ |