phpcs fixes

This commit is contained in:
Ron Rennick 2020-08-11 15:51:38 -03:00
parent 78c2a07306
commit 22867c41c1
1 changed files with 5 additions and 5 deletions

View File

@ -234,9 +234,9 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Product_Variations_V
if ( ! $parent ) {
return new WP_Error(
// Translators: %d parent ID.
"woocommerce_rest_{$this->post_type}_invalid_parent", sprintf( __( 'Cannot set attributes due to invalid parent product.', 'woocommerce' ), $variation->get_parent_id() ), array(
'status' => 404,
)
"woocommerce_rest_{$this->post_type}_invalid_parent",
__( 'Cannot set attributes due to invalid parent product.', 'woocommerce' ),
array( 'status' => 404 )
);
}
@ -359,8 +359,8 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Product_Variations_V
$upload = wc_rest_upload_image_from_url( esc_url_raw( $image['src'] ) );
if ( is_wp_error( $upload ) ) {
if ( ! apply_filters( 'woocommerce_rest_suppress_image_upload_error', false, $upload, $variation->get_id(), array($image))) {
throw new WC_REST_Exception( 'woocommerce_variation_image_upload_error', $upload->get_error_message(), 400);
if ( ! apply_filters( 'woocommerce_rest_suppress_image_upload_error', false, $upload, $variation->get_id(), array( $image ) ) ) {
throw new WC_REST_Exception( 'woocommerce_variation_image_upload_error', $upload->get_error_message(), 400 );
}
}