Skip to content

Commit 83c8aed

Browse files
committed
WPCS compliance met
1 parent 66690f0 commit 83c8aed

File tree

3 files changed

+24
-25
lines changed

3 files changed

+24
-25
lines changed

includes/connection/class-customers.php

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ class Customers {
2525
public static function register_connections() {
2626
register_graphql_connection(
2727
array(
28-
'fromType' => 'RootQuery',
29-
'toType' => 'Customer',
30-
'fromFieldName' => 'customers',
28+
'fromType' => 'RootQuery',
29+
'toType' => 'Customer',
30+
'fromFieldName' => 'customers',
3131
'connectionArgs' => self::get_connection_args(),
3232
'resolve' => function ( $source, array $args, AppContext $context, ResolveInfo $info ) {
3333
$resolver = new UserConnectionResolver( $source, $args, $context, $info );
@@ -48,9 +48,9 @@ public static function register_connections() {
4848

4949
register_graphql_connection(
5050
array(
51-
'fromType' => 'Coupon',
52-
'toType' => 'Customer',
53-
'fromFieldName' => 'usedBy',
51+
'fromType' => 'Coupon',
52+
'toType' => 'Customer',
53+
'fromFieldName' => 'usedBy',
5454
'connectionArgs' => self::get_connection_args(),
5555
'resolve' => function ( $source, array $args, AppContext $context, ResolveInfo $info ) {
5656
$resolver = new UserConnectionResolver( $source, $args, $context, $info );
@@ -89,27 +89,27 @@ public static function should_execute() {
8989
*/
9090
public static function get_connection_args(): array {
9191
return array(
92-
'search' => array(
92+
'search' => array(
9393
'type' => 'String',
9494
'description' => __( 'Limit results to those matching a string.', 'wp-graphql-woocommerce' ),
9595
),
96-
'exclude' => array(
96+
'exclude' => array(
9797
'type' => array( 'list_of' => 'Int' ),
9898
'description' => __( 'Ensure result set excludes specific IDs.', 'wp-graphql-woocommerce' ),
9999
),
100-
'include' => array(
100+
'include' => array(
101101
'type' => array( 'list_of' => 'Int' ),
102102
'description' => __( 'Limit result set to specific ids.', 'wp-graphql-woocommerce' ),
103103
),
104-
'email' => array(
104+
'email' => array(
105105
'type' => 'String',
106106
'description' => __( 'Limit result set to resources with a specific email.', 'wp-graphql-woocommerce' ),
107107
),
108-
'orderby' => array(
108+
'orderby' => array(
109109
'type' => 'CustomerConnectionOrderbyEnum',
110110
'description' => __( 'Order results by a specific field.', 'wp-graphql-woocommerce' ),
111111
),
112-
'order' => array(
112+
'order' => array(
113113
'type' => 'OrderEnum',
114114
'description' => __( 'Order of results.', 'wp-graphql-woocommerce' ),
115115
),
@@ -120,21 +120,20 @@ public static function get_connection_args(): array {
120120
* This allows plugins/themes to hook in and alter what $args should be allowed to be passed
121121
* from a GraphQL Query to the WP_Query
122122
*
123-
* @param array $query_args The mapped query arguments.
124-
* @param array $where_args Query "where" args.
125-
* @param mixed $source The query results for a query calling this.
126-
* @param array $args All of the arguments for the query (not just the "where" args).
127-
* @param AppContext $context The AppContext object.
128-
* @param ResolveInfo $info The ResolveInfo object.
123+
* @param array $query_args The mapped query arguments.
124+
* @param array $where_args Query "where" args.
125+
* @param mixed $source The query results for a query calling this.
126+
* @param array $args All of the arguments for the query (not just the "where" args).
127+
* @param AppContext $context The AppContext object.
128+
* @param ResolveInfo $info The ResolveInfo object.
129129
*
130130
* @return array Query arguments.
131131
*/
132132
public static function map_input_fields_to_wp_query( $query_args, $where_args, $source, $args, $context, $info ) {
133-
134133
$key_mapping = array(
135-
'search' => 'search',
136-
'exclude' => 'exclude',
137-
'include' => 'include',
134+
'search' => 'search',
135+
'exclude' => 'exclude',
136+
'include' => 'include',
138137
);
139138

140139
foreach ( $key_mapping as $key => $field ) {

includes/data/loader/class-wc-customer-loader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function loadKeys( array $keys ) {
7676
*/
7777
public static function inject_user_loader_models( $model, $entry, $key ) {
7878
if ( is_null( $model ) && is_a( $entry, \WP_User::class ) ) {
79-
if ( in_array( 'customer', (array) $entry->roles ) ) {
79+
if ( in_array( 'customer', (array) $entry->roles, true ) ) {
8080
$model = new Customer( $key );
8181
}
8282
}

vendor/composer/installed.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
'type' => 'wordpress-plugin',
66
'install_path' => __DIR__ . '/../../',
77
'aliases' => array(),
8-
'reference' => 'a98998d279053eec327d5d6b34e11d744f9d78d7',
8+
'reference' => '66690f03ffabca476f723bab00441d08c1e016fd',
99
'name' => 'wp-graphql/wp-graphql-woocommerce',
1010
'dev' => false,
1111
),
@@ -25,7 +25,7 @@
2525
'type' => 'wordpress-plugin',
2626
'install_path' => __DIR__ . '/../../',
2727
'aliases' => array(),
28-
'reference' => 'a98998d279053eec327d5d6b34e11d744f9d78d7',
28+
'reference' => '66690f03ffabca476f723bab00441d08c1e016fd',
2929
'dev_requirement' => false,
3030
),
3131
),

0 commit comments

Comments
 (0)