From bf43be3e9ec23c40c38cd6255c9ba64fb74a9884 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 22 May 2015 06:18:25 +0000 Subject: [PATCH] Add missing doc blocks to `wp-image-editor*.php`. See #32444. Built from https://develop.svn.wordpress.org/trunk@32546 git-svn-id: http://core.svn.wordpress.org/trunk@32516 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-http-ixr-client.php | 3 +++ wp-includes/class-wp-image-editor-gd.php | 16 +++++++++++++--- wp-includes/class-wp-image-editor-imagick.php | 18 +++++++++++++----- wp-includes/class-wp-image-editor.php | 6 +++--- wp-includes/version.php | 2 +- 5 files changed, 33 insertions(+), 12 deletions(-) diff --git a/wp-includes/class-wp-http-ixr-client.php b/wp-includes/class-wp-http-ixr-client.php index 0605955d49..e0309bf9f4 100644 --- a/wp-includes/class-wp-http-ixr-client.php +++ b/wp-includes/class-wp-http-ixr-client.php @@ -46,6 +46,9 @@ class WP_HTTP_IXR_Client extends IXR_Client { $this->timeout = $timeout; } + /** + * @return bool + */ public function query() { $args = func_get_args(); $method = array_shift($args); diff --git a/wp-includes/class-wp-image-editor-gd.php b/wp-includes/class-wp-image-editor-gd.php index 371552c28c..616874be4a 100644 --- a/wp-includes/class-wp-image-editor-gd.php +++ b/wp-includes/class-wp-image-editor-gd.php @@ -33,6 +33,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor { * @since 3.5.0 * @access public * + * @param array $args * @return boolean */ public static function test( $args = array() ) { @@ -127,6 +128,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor { * * @param int $width * @param int $height + * @return true */ protected function update_size( $width = false, $height = false ) { if ( ! $width ) @@ -152,7 +154,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor { * @param int|null $max_w Image width. * @param int|null $max_h Image height. * @param boolean $crop - * @return boolean|WP_Error + * @return true|WP_Error */ public function resize( $max_w, $max_h, $crop = false ) { if ( ( $this->size['width'] == $max_w ) && ( $this->size['height'] == $max_h ) ) @@ -171,6 +173,13 @@ class WP_Image_Editor_GD extends WP_Image_Editor { return new WP_Error( 'image_resize_error', __('Image resize failed.'), $this->file ); } + /** + * + * @param int $max_w + * @param int $max_h + * @param bool|array $crop + * @return resource|WP_Error + */ protected function _resize( $max_w, $max_h, $crop = false ) { $dims = image_resize_dimensions( $this->size['width'], $this->size['height'], $max_w, $max_h, $crop ); if ( ! $dims ) { @@ -303,7 +312,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor { * @access public * * @param float $angle - * @return boolean|WP_Error + * @return true|WP_Error */ public function rotate( $angle ) { if ( function_exists('imagerotate') ) { @@ -330,7 +339,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor { * * @param boolean $horz Flip along Horizontal Axis * @param boolean $vert Flip along Vertical Axis - * @returns boolean|WP_Error + * @returns true|WP_Error */ public function flip( $horz, $vert ) { $w = $this->size['width']; @@ -433,6 +442,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor { * @access public * * @param string $mime_type + * @return bool */ public function stream( $mime_type = null ) { list( $filename, $extension, $mime_type ) = $this->get_output_format( null, $mime_type ); diff --git a/wp-includes/class-wp-image-editor-imagick.php b/wp-includes/class-wp-image-editor-imagick.php index a70bebdaeb..d50ad61b8e 100644 --- a/wp-includes/class-wp-image-editor-imagick.php +++ b/wp-includes/class-wp-image-editor-imagick.php @@ -37,6 +37,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { * @since 3.5.0 * @access public * + * @param array $args * @return boolean */ public static function test( $args = array() ) { @@ -112,7 +113,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { * @since 3.5.0 * @access protected * - * @return boolean|WP_Error True if loaded; WP_Error on failure. + * @return true|WP_Error True if loaded; WP_Error on failure. */ public function load() { if ( $this->image instanceof Imagick ) @@ -156,7 +157,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { * @access public * * @param int $quality Compression Quality. Range: [1,100] - * @return boolean|WP_Error True if set successfully; WP_Error on failure. + * @return true|WP_Error True if set successfully; WP_Error on failure. */ public function set_quality( $quality = null ) { $quality_result = parent::set_quality( $quality ); @@ -374,7 +375,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { * @access public * * @param float $angle - * @return boolean|WP_Error + * @return true|WP_Error */ public function rotate( $angle ) { /** @@ -405,7 +406,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { * * @param boolean $horz Flip along Horizontal Axis * @param boolean $vert Flip along Vertical Axis - * @returns boolean|WP_Error + * @returns true|WP_Error */ public function flip( $horz, $vert ) { try { @@ -449,6 +450,13 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { return $saved; } + /** + * + * @param Imagick $image + * @param string $filename + * @param string $mime_type + * @return array|WP_Error + */ protected function _save( $image, $filename = null, $mime_type = null ) { list( $filename, $extension, $mime_type ) = $this->get_output_format( $filename, $mime_type ); @@ -491,7 +499,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { * @access public * * @param string $mime_type - * @return boolean|WP_Error + * @return true|WP_Error */ public function stream( $mime_type = null ) { list( $filename, $extension, $mime_type ) = $this->get_output_format( null, $mime_type ); diff --git a/wp-includes/class-wp-image-editor.php b/wp-includes/class-wp-image-editor.php index 58643d42e4..bfc43793df 100644 --- a/wp-includes/class-wp-image-editor.php +++ b/wp-includes/class-wp-image-editor.php @@ -226,7 +226,7 @@ abstract class WP_Image_Editor { * @access public * * @param int $quality Compression Quality. Range: [1,100] - * @return boolean|WP_Error True if set successfully; WP_Error on failure. + * @return true|WP_Error True if set successfully; WP_Error on failure. */ public function set_quality( $quality = null ) { if ( null === $quality ) { @@ -445,7 +445,7 @@ abstract class WP_Image_Editor { * @access protected * * @param string $extension - * @return string|boolean + * @return string|false */ protected static function get_mime_type( $extension = null ) { if ( ! $extension ) @@ -471,7 +471,7 @@ abstract class WP_Image_Editor { * @access protected * * @param string $mime_type - * @return string|boolean + * @return string|false */ protected static function get_extension( $mime_type = null ) { $extensions = explode( '|', array_search( $mime_type, wp_get_mime_types() ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 5b7de1fe97..4948c592b2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32545'; +$wp_version = '4.3-alpha-32546'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.