Merge pull request #7275 from woothemes/scrutinizer-patch-1

Scrutinizer Auto-Fixes
This commit is contained in:
Mike Jolley 2015-02-03 14:32:25 +00:00
commit 7475eb89d7
6 changed files with 10 additions and 8 deletions

View File

@ -71,7 +71,7 @@ class WC_Frontend_Scripts {
* @access private * @access private
* @param string $handle [description] * @param string $handle [description]
* @param string $path [description] * @param string $path [description]
* @param array $deps [description] * @param string[] $deps [description]
* @param string $version [description] * @param string $version [description]
* @param boolean $in_footer [description] * @param boolean $in_footer [description]
*/ */

View File

@ -91,6 +91,7 @@ class WC_Tax {
* return round( $in / 5, 2 ) * 5; * return round( $in / 5, 2 ) * 5;
* } * }
* add_filter( 'woocommerce_tax_round', 'euro_5cent_rounding' ); * add_filter( 'woocommerce_tax_round', 'euro_5cent_rounding' );
* @return double
*/ */
public static function round( $in ) { public static function round( $in ) {
return apply_filters( 'woocommerce_tax_round', round( $in, self::$precision ), $in ); return apply_filters( 'woocommerce_tax_round', round( $in, self::$precision ), $in );
@ -255,7 +256,7 @@ class WC_Tax {
* @param string $postcode * @param string $postcode
* @param string $city * @param string $city
* @param string $tax_class * @param string $tax_class
* @param array $valid_postcodes * @param string[] $valid_postcodes
* @return array * @return array
*/ */
private static function get_matched_tax_rates( $country, $state, $postcode, $city, $tax_class, $valid_postcodes ) { 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 * format the rate
* @param double $rate * @param double $rate
* @return float * @return string
*/ */
private static function format_tax_rate( $rate ) { private static function format_tax_rate( $rate ) {
return number_format( (double) $rate, 4, '.', '' ); return number_format( (double) $rate, 4, '.', '' );
@ -786,7 +787,7 @@ class WC_Tax {
* @access private * @access private
* *
* @param int $tax_rate_id * @param int $tax_rate_id
* @param string $cities * @param string $type
* @return string * @return string
*/ */
private static function _update_tax_rate_locations( $tax_rate_id, $values, $type ) { private static function _update_tax_rate_locations( $tax_rate_id, $values, $type ) {
@ -847,7 +848,7 @@ class WC_Tax {
* @access private * @access private
* *
* @param string $postcode array of values * @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 ) { private static function _get_wildcard_postcodes( $postcode ) {
$postcodes = array( '*', strtoupper( $postcode ) ); $postcodes = array( '*', strtoupper( $postcode ) );

View File

@ -249,7 +249,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
* @param int $order_id * @param int $order_id
* @param float $amount * @param float $amount
* @param string $reason * @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 = '' ) { public function process_refund( $order_id, $amount = null, $reason = '' ) {
$order = wc_get_order( $order_id ); $order = wc_get_order( $order_id );

View File

@ -137,7 +137,6 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
/** /**
* Check payment amount from IPN matches the order * Check payment amount from IPN matches the order
* @param WC_Order $order * @param WC_Order $order
* @param string $currency
*/ */
private function validate_amount( $order, $amount ) { private function validate_amount( $order, $amount ) {
if ( number_format( $order->get_total(), 2, '.', '' ) != number_format( $amount, 2, '.', '' ) ) { 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 * Check payment amount from IPN matches the order
* @param WC_Order $order * @param WC_Order $order
* @param string $currency
*/ */
private function validate_receiver_email( $order, $receiver_email ) { private function validate_receiver_email( $order, $receiver_email ) {
if ( strcasecmp( trim( $receiver_email ), trim( $this->receiver_email ) ) != 0 ) { 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 * Save important data from the IPN to the order
* @param WC_Order $order
*/ */
private function save_paypal_meta_data( $order, $posted ) { private function save_paypal_meta_data( $order, $posted ) {
if ( ! empty( $posted['payer_email'] ) ) { if ( ! empty( $posted['payer_email'] ) ) {

View File

@ -29,6 +29,7 @@ class WC_Gateway_Paypal_Request {
/** /**
* Constructor * Constructor
* @param WC_Gateway_Paypal $gateway
*/ */
public function __construct( $gateway ) { public function __construct( $gateway ) {
$this->gateway = $gateway; $this->gateway = $gateway;

View File

@ -370,6 +370,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
/** /**
* Process standard payments * Process standard payments
* *
* @param WC_Order $order
* @return array * @return array
*/ */
protected function process_hosted_payments( $order ) { protected function process_hosted_payments( $order ) {