Merge pull request #7275 from woothemes/scrutinizer-patch-1
Scrutinizer Auto-Fixes
This commit is contained in:
commit
7475eb89d7
|
@ -71,7 +71,7 @@ class WC_Frontend_Scripts {
|
|||
* @access private
|
||||
* @param string $handle [description]
|
||||
* @param string $path [description]
|
||||
* @param array $deps [description]
|
||||
* @param string[] $deps [description]
|
||||
* @param string $version [description]
|
||||
* @param boolean $in_footer [description]
|
||||
*/
|
||||
|
|
|
@ -91,6 +91,7 @@ class WC_Tax {
|
|||
* return round( $in / 5, 2 ) * 5;
|
||||
* }
|
||||
* add_filter( 'woocommerce_tax_round', 'euro_5cent_rounding' );
|
||||
* @return double
|
||||
*/
|
||||
public static function round( $in ) {
|
||||
return apply_filters( 'woocommerce_tax_round', round( $in, self::$precision ), $in );
|
||||
|
@ -255,7 +256,7 @@ class WC_Tax {
|
|||
* @param string $postcode
|
||||
* @param string $city
|
||||
* @param string $tax_class
|
||||
* @param array $valid_postcodes
|
||||
* @param string[] $valid_postcodes
|
||||
* @return array
|
||||
*/
|
||||
private static function get_matched_tax_rates( $country, $state, $postcode, $city, $tax_class, $valid_postcodes ) {
|
||||
|
@ -634,7 +635,7 @@ class WC_Tax {
|
|||
/**
|
||||
* format the rate
|
||||
* @param double $rate
|
||||
* @return float
|
||||
* @return string
|
||||
*/
|
||||
private static function format_tax_rate( $rate ) {
|
||||
return number_format( (double) $rate, 4, '.', '' );
|
||||
|
@ -786,7 +787,7 @@ class WC_Tax {
|
|||
* @access private
|
||||
*
|
||||
* @param int $tax_rate_id
|
||||
* @param string $cities
|
||||
* @param string $type
|
||||
* @return string
|
||||
*/
|
||||
private static function _update_tax_rate_locations( $tax_rate_id, $values, $type ) {
|
||||
|
@ -847,7 +848,7 @@ class WC_Tax {
|
|||
* @access private
|
||||
*
|
||||
* @param string $postcode array of values
|
||||
* @return array Array of postcodes with wildcards
|
||||
* @return string[] Array of postcodes with wildcards
|
||||
*/
|
||||
private static function _get_wildcard_postcodes( $postcode ) {
|
||||
$postcodes = array( '*', strtoupper( $postcode ) );
|
||||
|
|
|
@ -249,7 +249,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
|
|||
* @param int $order_id
|
||||
* @param float $amount
|
||||
* @param string $reason
|
||||
* @return bool|wp_error True or false based on success, or a WP_Error object
|
||||
* @return boolean True or false based on success, or a WP_Error object
|
||||
*/
|
||||
public function process_refund( $order_id, $amount = null, $reason = '' ) {
|
||||
$order = wc_get_order( $order_id );
|
||||
|
|
|
@ -137,7 +137,6 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
|
|||
/**
|
||||
* Check payment amount from IPN matches the order
|
||||
* @param WC_Order $order
|
||||
* @param string $currency
|
||||
*/
|
||||
private function validate_amount( $order, $amount ) {
|
||||
if ( number_format( $order->get_total(), 2, '.', '' ) != number_format( $amount, 2, '.', '' ) ) {
|
||||
|
@ -152,7 +151,6 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
|
|||
/**
|
||||
* Check payment amount from IPN matches the order
|
||||
* @param WC_Order $order
|
||||
* @param string $currency
|
||||
*/
|
||||
private function validate_receiver_email( $order, $receiver_email ) {
|
||||
if ( strcasecmp( trim( $receiver_email ), trim( $this->receiver_email ) ) != 0 ) {
|
||||
|
@ -272,6 +270,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
|
|||
|
||||
/**
|
||||
* Save important data from the IPN to the order
|
||||
* @param WC_Order $order
|
||||
*/
|
||||
private function save_paypal_meta_data( $order, $posted ) {
|
||||
if ( ! empty( $posted['payer_email'] ) ) {
|
||||
|
|
|
@ -29,6 +29,7 @@ class WC_Gateway_Paypal_Request {
|
|||
|
||||
/**
|
||||
* Constructor
|
||||
* @param WC_Gateway_Paypal $gateway
|
||||
*/
|
||||
public function __construct( $gateway ) {
|
||||
$this->gateway = $gateway;
|
||||
|
|
|
@ -370,6 +370,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
|
|||
/**
|
||||
* Process standard payments
|
||||
*
|
||||
* @param WC_Order $order
|
||||
* @return array
|
||||
*/
|
||||
protected function process_hosted_payments( $order ) {
|
||||
|
|
Loading…
Reference in New Issue