diff --git a/includes/class-wc-order-refund.php b/includes/class-wc-order-refund.php index 2eaff79bcd5..55b498d95e9 100644 --- a/includes/class-wc-order-refund.php +++ b/includes/class-wc-order-refund.php @@ -1,16 +1,16 @@ set_prop( 'amount', wc_format_decimal( $value ) ); @@ -132,8 +134,8 @@ class WC_Order_Refund extends WC_Abstract_Order { /** * Set refund reason. * - * @param string $value - * @throws WC_Data_Exception + * @param string $value Value to set. + * @throws WC_Data_Exception Exception if the amount is invalid. */ public function set_reason( $value ) { $this->set_prop( 'reason', $value ); @@ -142,8 +144,8 @@ class WC_Order_Refund extends WC_Abstract_Order { /** * Set refunded by. * - * @param int $value - * @throws WC_Data_Exception + * @param int $value Value to set. + * @throws WC_Data_Exception Exception if the amount is invalid. */ public function set_refunded_by( $value ) { $this->set_prop( 'refunded_by', absint( $value ) ); @@ -153,7 +155,7 @@ class WC_Order_Refund extends WC_Abstract_Order { * Set if the payment was refunded via API. * * @since 3.3 - * @param bool $value + * @param bool $value Value to set. */ public function set_refunded_payment( $value ) { $this->set_prop( 'refunded_payment', (bool) $value ); @@ -162,7 +164,7 @@ class WC_Order_Refund extends WC_Abstract_Order { /** * Magic __get method for backwards compatibility. * - * @param string $key + * @param string $key Value to get. * @return mixed */ public function __get( $key ) { @@ -180,24 +182,31 @@ class WC_Order_Refund extends WC_Abstract_Order { /** * Gets an refund from the database. + * * @deprecated 3.0 * @param int $id (default: 0). * @return bool */ public function get_refund( $id = 0 ) { wc_deprecated_function( 'get_refund', '3.0', 'read' ); + if ( ! $id ) { return false; } - if ( $result = get_post( $id ) ) { + + $result = get_post( $id ); + + if ( $result ) { $this->populate( $result ); return true; } + return false; } /** * Get refund amount. + * * @deprecated 3.0 * @return int|float */ @@ -208,6 +217,7 @@ class WC_Order_Refund extends WC_Abstract_Order { /** * Get refund reason. + * * @deprecated 3.0 * @return int|float */