Coding Standards: Main plugin file

* fixed indentation - swapped spaces for tabs at start of line, swapped
tabs for spaces min-line for alignment
* removed instances of `@return void` and `@access public`

@see http://make.wordpress.org/core/handbook/coding-standards/php/
This commit is contained in:
Tamara Zuk 2014-08-31 01:41:40 -04:00
parent 47b9e54797
commit 59424e5fcf
1 changed files with 46 additions and 46 deletions

View File

@ -77,9 +77,9 @@ final class WooCommerce {
public $customer = null;
/**
* @var WC_Order_Factory $order_factory
*/
public $order_factory = null;
* @var WC_Order_Factory $order_factory
*/
public $order_factory = null;
/**
* Main WooCommerce Instance
@ -193,7 +193,6 @@ final class WooCommerce {
* Auto-load WC classes on demand to reduce memory consumption.
*
* @param mixed $class
* @return void
*/
public function autoload( $class ) {
$path = null;
@ -278,27 +277,27 @@ final class WooCommerce {
}
// Query class
$this->query = include( 'includes/class-wc-query.php' ); // The main query class
$this->query = include( 'includes/class-wc-query.php' ); // The main query class
// Post types
include_once( 'includes/class-wc-post-types.php' ); // Registers post types
include_once( 'includes/class-wc-post-types.php' ); // Registers post types
// API Class
include_once( 'includes/class-wc-api.php' );
// Include abstract classes
include_once( 'includes/abstracts/abstract-wc-product.php' ); // Products
include_once( 'includes/abstracts/abstract-wc-order.php' ); // Orders
include_once( 'includes/abstracts/abstract-wc-settings-api.php' ); // Settings API (for gateways, shipping, and integrations)
include_once( 'includes/abstracts/abstract-wc-shipping-method.php' ); // A Shipping method
include_once( 'includes/abstracts/abstract-wc-payment-gateway.php' ); // A Payment gateway
include_once( 'includes/abstracts/abstract-wc-integration.php' ); // An integration with a service
include_once( 'includes/abstracts/abstract-wc-product.php' ); // Products
include_once( 'includes/abstracts/abstract-wc-order.php' ); // Orders
include_once( 'includes/abstracts/abstract-wc-settings-api.php' ); // Settings API (for gateways, shipping, and integrations)
include_once( 'includes/abstracts/abstract-wc-shipping-method.php' ); // A Shipping method
include_once( 'includes/abstracts/abstract-wc-payment-gateway.php' ); // A Payment gateway
include_once( 'includes/abstracts/abstract-wc-integration.php' ); // An integration with a service
// Classes (used on all pages)
include_once( 'includes/class-wc-product-factory.php' ); // Product factory
include_once( 'includes/class-wc-countries.php' ); // Defines countries and states
include_once( 'includes/class-wc-integrations.php' ); // Loads integrations
include_once( 'includes/class-wc-cache-helper.php' ); // Cache Helper
include_once( 'includes/class-wc-product-factory.php' ); // Product factory
include_once( 'includes/class-wc-countries.php' ); // Defines countries and states
include_once( 'includes/class-wc-integrations.php' ); // Loads integrations
include_once( 'includes/class-wc-cache-helper.php' ); // Cache Helper
// Download/update languages
include_once( 'includes/class-wc-language-pack-upgrader.php' );
@ -308,7 +307,7 @@ final class WooCommerce {
* Include required ajax files.
*/
public function ajax_includes() {
include_once( 'includes/class-wc-ajax.php' ); // Ajax functions for admin and the front-end
include_once( 'includes/class-wc-ajax.php' ); // Ajax functions for admin and the front-end
}
/**
@ -323,14 +322,14 @@ final class WooCommerce {
include_once( 'includes/abstracts/abstract-wc-session.php' );
include_once( 'includes/class-wc-session-handler.php' );
include_once( 'includes/wc-template-hooks.php' );
include_once( 'includes/class-wc-template-loader.php' ); // Template Loader
include_once( 'includes/class-wc-frontend-scripts.php' ); // Frontend Scripts
include_once( 'includes/class-wc-form-handler.php' ); // Form Handlers
include_once( 'includes/class-wc-cart.php' ); // The main cart class
include_once( 'includes/class-wc-tax.php' ); // Tax class
include_once( 'includes/class-wc-customer.php' ); // Customer class
include_once( 'includes/class-wc-shortcodes.php' ); // Shortcodes class
include_once( 'includes/class-wc-https.php' ); // https Helper
include_once( 'includes/class-wc-template-loader.php' ); // Template Loader
include_once( 'includes/class-wc-frontend-scripts.php' ); // Frontend Scripts
include_once( 'includes/class-wc-form-handler.php' ); // Form Handlers
include_once( 'includes/class-wc-cart.php' ); // The main cart class
include_once( 'includes/class-wc-tax.php' ); // Tax class
include_once( 'includes/class-wc-customer.php' ); // Customer class
include_once( 'includes/class-wc-shortcodes.php' ); // Shortcodes class
include_once( 'includes/class-wc-https.php' ); // https Helper
}
/**
@ -348,17 +347,17 @@ final class WooCommerce {
public function include_widgets() {
include_once( 'includes/abstracts/abstract-wc-widget.php' );
register_widget( 'WC_Widget_Cart' );
register_widget( 'WC_Widget_Products' );
register_widget( 'WC_Widget_Layered_Nav' );
register_widget( 'WC_Widget_Layered_Nav_Filters' );
register_widget( 'WC_Widget_Price_Filter' );
register_widget( 'WC_Widget_Product_Categories' );
register_widget( 'WC_Widget_Product_Search' );
register_widget( 'WC_Widget_Product_Tag_Cloud' );
register_widget( 'WC_Widget_Recent_Reviews' );
register_widget( 'WC_Widget_Recently_Viewed' );
register_widget( 'WC_Widget_Top_Rated_Products' );
register_widget( 'WC_Widget_Cart' );
register_widget( 'WC_Widget_Products' );
register_widget( 'WC_Widget_Layered_Nav' );
register_widget( 'WC_Widget_Layered_Nav_Filters' );
register_widget( 'WC_Widget_Price_Filter' );
register_widget( 'WC_Widget_Product_Categories' );
register_widget( 'WC_Widget_Product_Search' );
register_widget( 'WC_Widget_Product_Tag_Cloud' );
register_widget( 'WC_Widget_Recent_Reviews' );
register_widget( 'WC_Widget_Recently_Viewed' );
register_widget( 'WC_Widget_Top_Rated_Products' );
}
/**
@ -372,10 +371,10 @@ final class WooCommerce {
$this->load_plugin_textdomain();
// Load class instances
$this->product_factory = new WC_Product_Factory(); // Product Factory to create new product instances
$this->order_factory = new WC_Order_Factory(); // Order Factory to create new order instances
$this->countries = new WC_Countries(); // Countries class
$this->integrations = new WC_Integrations(); // Integrations class
$this->product_factory = new WC_Product_Factory(); // Product Factory to create new product instances
$this->order_factory = new WC_Order_Factory(); // Order Factory to create new order instances
$this->countries = new WC_Countries(); // Countries class
$this->integrations = new WC_Integrations(); // Integrations class
// Classes/actions loaded for the frontend and for ajax requests
if ( ! is_admin() || defined( 'DOING_AJAX' ) ) {
@ -384,8 +383,8 @@ final class WooCommerce {
// Class instances
$this->session = new $session_class();
$this->cart = new WC_Cart(); // Cart class, stores the cart contents
$this->customer = new WC_Customer(); // Customer class, handles data such as customer location
$this->cart = new WC_Cart(); // Cart class, stores the cart contents
$this->customer = new WC_Customer(); // Customer class, handles data such as customer location
}
// Email Actions
@ -435,7 +434,7 @@ final class WooCommerce {
}
/**
* Ensure theme and server variable compatibility and setup image sizes..
* Ensure theme and server variable compatibility and setup image sizes.
*/
public function setup_environment() {
/**
@ -463,8 +462,9 @@ final class WooCommerce {
// IIS
if ( ! isset($_SERVER['REQUEST_URI'] ) ) {
$_SERVER['REQUEST_URI'] = substr( $_SERVER['PHP_SELF'], 1 );
if ( isset( $_SERVER['QUERY_STRING'] ) ) {
$_SERVER['REQUEST_URI'].='?'.$_SERVER['QUERY_STRING'];
$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
}
}
@ -537,7 +537,7 @@ final class WooCommerce {
$scheme = 'http';
}
if ( get_option('permalink_structure') ) {
if ( get_option( 'permalink_structure' ) ) {
return esc_url_raw( trailingslashit( home_url( '/wc-api/' . $request, $scheme ) ) );
} else {
return esc_url_raw( add_query_arg( 'wc-api', $request, trailingslashit( home_url( '', $scheme ) ) ) );
@ -546,8 +546,8 @@ final class WooCommerce {
/**
* Init the mailer and call the notifications for the current filter.
*
* @internal param array $args (default: array())
* @return void
*/
public function send_transactional_email() {
$this->mailer();