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

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

View File

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