Code changes as suggested in #4238

This commit is contained in:
Coen Jacobs 2013-11-28 14:12:08 +01:00
parent d9039672bc
commit 5291f2eec6
3 changed files with 6 additions and 13 deletions

View File

@ -157,11 +157,9 @@ abstract class WC_Shipping_Method extends WC_Settings_API {
*
* @access public
* @return bool
* @todo Must return false if does not
*/
function has_settings() {
if ( $this->has_settings )
return true;
return ( $this->has_settings );
}
/**
@ -171,9 +169,6 @@ abstract class WC_Shipping_Method extends WC_Settings_API {
* @return bool
*/
public function is_available( $package ) {
/** @todo Delete this */
global $woocommerce;
if ( $this->enabled == "no" )
return false;
@ -234,4 +229,4 @@ abstract class WC_Shipping_Method extends WC_Settings_API {
function supports( $feature ) {
return apply_filters( 'woocommerce_shipping_method_supports', in_array( $feature, $this->supports ) ? true : false, $feature, $this );
}
}
}

View File

@ -262,8 +262,7 @@ class WC_Admin_Assets {
*/
public function product_taxonomy_styles() {
/** @todo This should be just 'return', without false */
if ( ! current_user_can( 'manage_woocommerce' ) ) return false;
if ( ! current_user_can( 'manage_woocommerce' ) ) return;
?>
<style type="text/css">
<?php if ( isset($_GET['taxonomy']) && $_GET['taxonomy']=='product_cat' ) : ?>
@ -278,4 +277,4 @@ class WC_Admin_Assets {
endif;
return new WC_Admin_Assets();
return new WC_Admin_Assets();

View File

@ -49,8 +49,7 @@ class WC_Widget_Layered_Nav extends WC_Widget {
*/
public function form( $instance ) {
$this->init_settings();
/** @todo This must be only call to parent, with no return. It's a void function */
return parent::form( $instance );
parent::form( $instance );
}
/**
@ -386,4 +385,4 @@ class WC_Widget_Layered_Nav extends WC_Widget {
}
}
register_widget( 'WC_Widget_Layered_Nav' );
register_widget( 'WC_Widget_Layered_Nav' );