Fix code style/sniffer errors in a few files.

This commit is contained in:
Nestor Soriano 2020-10-02 09:34:09 +02:00
parent d245a60c6e
commit 53d33457e3
5 changed files with 26 additions and 11 deletions

View File

@ -35,7 +35,7 @@ class WC_Customer extends WC_Legacy_Customer {
'company' => '',
'address_1' => '',
'address_2' => '',
'city' => '',
'city' => '',
'postcode' => '',
'country' => '',
'state' => '',
@ -48,7 +48,7 @@ class WC_Customer extends WC_Legacy_Customer {
'company' => '',
'address_1' => '',
'address_2' => '',
'city' => '',
'city' => '',
'postcode' => '',
'country' => '',
'state' => '',

View File

@ -426,7 +426,7 @@ class WC_Order extends WC_Abstract_Order {
*/
public function get_base_data() {
return array_merge(
array( 'id' => $this->get_id() ),
array( 'id' => $this->get_id() ),
$this->data,
array( 'number' => $this->get_order_number() )
);

View File

@ -39,7 +39,9 @@ class WC_REST_Data_Continents_Controller extends WC_REST_Data_Controller {
*/
public function register_routes() {
register_rest_route(
$this->namespace, '/' . $this->rest_base, array(
$this->namespace,
'/' . $this->rest_base,
array(
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_items' ),
@ -49,7 +51,9 @@ class WC_REST_Data_Continents_Controller extends WC_REST_Data_Controller {
)
);
register_rest_route(
$this->namespace, '/' . $this->rest_base . '/(?P<location>[\w-]+)', array(
$this->namespace,
'/' . $this->rest_base . '/(?P<location>[\w-]+)',
array(
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_item' ),
@ -104,7 +108,8 @@ class WC_REST_Data_Continents_Controller extends WC_REST_Data_Controller {
if ( array_key_exists( $country_code, $locale_info ) ) {
// Defensive programming against unexpected changes in locale-info.php.
$country_data = wp_parse_args(
$locale_info[ $country_code ], array(
$locale_info[ $country_code ],
array(
'currency_code' => 'USD',
'currency_pos' => 'left',
'decimal_sep' => '.',

View File

@ -39,7 +39,9 @@ class WC_REST_Data_Countries_Controller extends WC_REST_Data_Controller {
*/
public function register_routes() {
register_rest_route(
$this->namespace, '/' . $this->rest_base, array(
$this->namespace,
'/' . $this->rest_base,
array(
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_items' ),
@ -49,7 +51,9 @@ class WC_REST_Data_Countries_Controller extends WC_REST_Data_Controller {
)
);
register_rest_route(
$this->namespace, '/' . $this->rest_base . '/(?P<location>[\w-]+)', array(
$this->namespace,
'/' . $this->rest_base . '/(?P<location>[\w-]+)',
array(
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_item' ),

View File

@ -36,7 +36,9 @@ class WC_REST_Data_Currencies_Controller extends WC_REST_Data_Controller {
*/
public function register_routes() {
register_rest_route(
$this->namespace, '/' . $this->rest_base, array(
$this->namespace,
'/' . $this->rest_base,
array(
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_items' ),
@ -46,7 +48,9 @@ class WC_REST_Data_Currencies_Controller extends WC_REST_Data_Controller {
)
);
register_rest_route(
$this->namespace, '/' . $this->rest_base . '/current', array(
$this->namespace,
'/' . $this->rest_base . '/current',
array(
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_current_item' ),
@ -56,7 +60,9 @@ class WC_REST_Data_Currencies_Controller extends WC_REST_Data_Controller {
)
);
register_rest_route(
$this->namespace, '/' . $this->rest_base . '/(?P<currency>[\w-]{3})', array(
$this->namespace,
'/' . $this->rest_base . '/(?P<currency>[\w-]{3})',
array(
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_item' ),