Skip to content

Commit 4ed9cb9

Browse files
authored
chore: use fully-qualified class names for PHPDoc types (#767)
* fix!: update deps to required versions * chore: use fqcn for PHPDoc types * chore: cleanup use statements
1 parent d4927b9 commit 4ed9cb9

File tree

80 files changed

+339
-483
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+339
-483
lines changed

access-functions.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
* @since 0.0.1
77
*/
88

9-
use WPGraphQL\WooCommerce\Utils\QL_Session_Handler;
10-
use WPGraphQL\WooCommerce\Utils\Transfer_Session_Handler;
11-
129
if ( ! function_exists( 'wc_graphql_starts_with' ) ) {
1310
/**
1411
* Checks if source string starts with the target string
@@ -287,7 +284,7 @@ function woographql_get_session_uid() {
287284
/**
288285
* Session Handler
289286
*
290-
* @var QL_Session_Handler|Transfer_Session_Handler $session
287+
* @var \WPGraphQL\WooCommerce\Utils\QL_Session_Handler|\WPGraphQL\WooCommerce\Utils\Transfer_Session_Handler $session
291288
*/
292289
$session = WC()->session;
293290
return $session->get_customer_id();
@@ -304,7 +301,7 @@ function woographql_get_session_token() {
304301
/**
305302
* Session Handler
306303
*
307-
* @var QL_Session_Handler|Transfer_Session_Handler $session
304+
* @var \WPGraphQL\WooCommerce\Utils\QL_Session_Handler|\WPGraphQL\WooCommerce\Utils\Transfer_Session_Handler $session
308305
*/
309306
$session = WC()->session;
310307
return $session->get_client_session_id();

includes/class-admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __construct() {
2626
/**
2727
* Registers the WooGraphQL Settings tab.
2828
*
29-
* @param Settings $manager Settings Manager.
29+
* @param \WPGraphQL\Admin\Settings\Settings $manager Settings Manager.
3030
* @return void
3131
*/
3232
public function register_settings( Settings $manager ) {

includes/class-core-schema-filters.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
namespace WPGraphQL\WooCommerce;
1010

1111
use GraphQL\Error\UserError;
12-
use WPGraphQL\WooCommerce\Data\Loader\WC_Customer_Loader;
12+
use WPGraphQL\WooCommerce\Data\Factory;
1313
use WPGraphQL\WooCommerce\Data\Loader\WC_CPT_Loader;
14+
use WPGraphQL\WooCommerce\Data\Loader\WC_Customer_Loader;
1415
use WPGraphQL\WooCommerce\Data\Loader\WC_Db_Loader;
15-
use WPGraphQL\WooCommerce\Data\Factory;
1616
use WPGraphQL\WooCommerce\WP_GraphQL_WooCommerce as WooGraphQL;
1717

1818
/**
@@ -360,7 +360,7 @@ public static function inject_union_type_resolver( $type, $value, $wp_union ) {
360360
* @param \WPGraphQL\Type\WPObjectType|null $type Type be resolve to.
361361
* @param mixed $value Object for which the type is being resolve config.
362362
*
363-
* @throws UserError Invalid product type received.
363+
* @throws \GraphQL\Error\UserError Invalid product type received.
364364
*
365365
* @return \WPGraphQL\Type\WPObjectType|null
366366
*/

includes/class-jwt-auth-schema-filters.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
use GraphQL\Error\UserError;
1313
use WPGraphQL\WooCommerce\Model\Customer;
14-
use WPGraphQL\WooCommerce\Utils\QL_Session_Handler;
15-
use WPGraphQL\WooCommerce\Utils\Transfer_Session_Handler;
1614

1715
/**
1816
* Class JWT_Auth_Schema_Filters
@@ -142,7 +140,7 @@ public static function add_customer_to_login_payload() {
142140
/**
143141
* Session Handler.
144142
*
145-
* @var QL_Session_Handler $session
143+
* @var \WPGraphQL\WooCommerce\Utils\QL_Session_Handler $session
146144
*/
147145
$session = \WC()->session;
148146

includes/class-wp-graphql-woocommerce.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ final class WP_GraphQL_WooCommerce {
2121
/**
2222
* Stores the instance of the WP_GraphQL_WooCommerce class
2323
*
24-
* @var null|WP_GraphQL_WooCommerce The one true WP_GraphQL_WooCommerce
24+
* @var null|\WPGraphQL\WooCommerce\WP_GraphQL_WooCommerce The one true WP_GraphQL_WooCommerce
2525
*/
2626
private static $instance = null;
2727

2828
/**
2929
* Returns a WP_GraphQL_WooCommerce Instance.
3030
*
31-
* @return WP_GraphQL_WooCommerce
31+
* @return \WPGraphQL\WooCommerce\WP_GraphQL_WooCommerce
3232
*/
3333
public static function instance() {
3434
if ( is_null( self::$instance ) ) {
@@ -40,7 +40,7 @@ public static function instance() {
4040
/**
4141
* Fire off init action
4242
*
43-
* @param WP_GraphQL_WooCommerce $instance The instance of the WP_GraphQL_WooCommerce class
43+
* @param \WPGraphQL\WooCommerce\WP_GraphQL_WooCommerce $instance The instance of the WP_GraphQL_WooCommerce class
4444
*/
4545
do_action( 'graphql_woocommerce_init', self::$instance );
4646

includes/connection/class-coupons.php

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99

1010
namespace WPGraphQL\WooCommerce\Connection;
1111

12-
use GraphQL\Error\UserError;
13-
use GraphQL\Type\Definition\ResolveInfo;
14-
use WPGraphQL\AppContext;
1512
use WPGraphQL\Data\Connection\PostObjectConnectionResolver;
1613

1714
/**
@@ -101,13 +98,13 @@ public static function get_connection_args(): array {
10198
* This allows plugins/themes to hook in and alter what $args should be allowed to be passed
10299
* from a GraphQL Query to the WP_Query
103100
*
104-
* @param array $query_args The mapped query arguments.
105-
* @param array $where_args Query "where" args.
106-
* @param mixed $source The query results for a query calling this.
107-
* @param array $args All of the arguments for the query (not just the "where" args).
108-
* @param AppContext $context The AppContext object.
109-
* @param ResolveInfo $info The ResolveInfo object.
110-
* @param mixed|string|array $post_type The post type for the query.
101+
* @param array $query_args The mapped query arguments.
102+
* @param array $where_args Query "where" args.
103+
* @param mixed $source The query results for a query calling this.
104+
* @param array $args All of the arguments for the query (not just the "where" args).
105+
* @param \WPGraphQL\AppContext $context The AppContext object.
106+
* @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object.
107+
* @param mixed|string|array $post_type The post type for the query.
111108
*
112109
* @return array Query arguments.
113110
*/
@@ -141,8 +138,8 @@ public static function map_input_fields_to_wp_query( $query_args, $where_args, $
141138
* @param array $where_args Query "where" args
142139
* @param mixed $source The query results for a query calling this
143140
* @param array $all_args All of the arguments for the query (not just the "where" args)
144-
* @param AppContext $context The AppContext object
145-
* @param ResolveInfo $info The ResolveInfo object
141+
* @param \WPGraphQL\AppContext $context The AppContext object
142+
* @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object
146143
*/
147144
$query_args = apply_filters(
148145
'graphql_map_input_fields_to_coupon_query',

includes/connection/class-customers.php

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
use GraphQL\Type\Definition\ResolveInfo;
1313
use WPGraphQL\AppContext;
14-
use WPGraphQL\Data\Connection\AbstractConnectionResolver;
1514
use WPGraphQL\Data\Connection\UserConnectionResolver;
1615
use WPGraphQL\WooCommerce\Model\Customer;
1716

@@ -126,12 +125,12 @@ public static function get_connection_args(): array {
126125
* This allows plugins/themes to hook in and alter what $args should be allowed to be passed
127126
* from a GraphQL Query to the WP_Query
128127
*
129-
* @param array $query_args The mapped query arguments.
130-
* @param array $where_args Query "where" args.
131-
* @param mixed $source The query results for a query calling this.
132-
* @param array $args All of the arguments for the query (not just the "where" args).
133-
* @param AppContext $context The AppContext object.
134-
* @param ResolveInfo $info The ResolveInfo object.
128+
* @param array $query_args The mapped query arguments.
129+
* @param array $where_args Query "where" args.
130+
* @param mixed $source The query results for a query calling this.
131+
* @param array $args All of the arguments for the query (not just the "where" args).
132+
* @param \WPGraphQL\AppContext $context The AppContext object.
133+
* @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object.
135134
*
136135
* @return array Query arguments.
137136
*/
@@ -173,12 +172,12 @@ public static function map_input_fields_to_wp_query( $query_args, $where_args, $
173172
* This allows plugins/themes to hook in and alter what $args should be allowed to be passed
174173
* from a GraphQL Query to the WP_Query
175174
*
176-
* @param array $args The mapped query arguments
177-
* @param array $where_args Query "where" args
178-
* @param mixed $source The query results for a query calling this
179-
* @param array $all_args All of the arguments for the query (not just the "where" args)
180-
* @param AppContext $context The AppContext object
181-
* @param ResolveInfo $info The ResolveInfo object
175+
* @param array $args The mapped query arguments
176+
* @param array $where_args Query "where" args
177+
* @param mixed $source The query results for a query calling this
178+
* @param array $all_args All of the arguments for the query (not just the "where" args)
179+
* @param \WPGraphQL\AppContext $context The AppContext object
180+
* @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object
182181
*/
183182
$query_args = apply_filters(
184183
'graphql_map_input_fields_to_customer_query',
@@ -197,8 +196,8 @@ public static function map_input_fields_to_wp_query( $query_args, $where_args, $
197196
* Temporary function until necessary functionality
198197
* has been added to the UserConnectionResolver
199198
*
200-
* @param array $connection Resolved connection.
201-
* @param AbstractConnectionResolver $resolver Resolver class.
199+
* @param array $connection Resolved connection.
200+
* @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $resolver Resolver class.
202201
*
203202
* @return array
204203
*/

includes/connection/class-orders.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99

1010
namespace WPGraphQL\WooCommerce\Connection;
1111

12-
use Automattic\WooCommerce\Utilities\OrderUtil;
1312
use GraphQL\Type\Definition\ResolveInfo;
1413
use WPGraphQL\AppContext;
15-
use WPGraphQL\Data\Connection\PostObjectConnectionResolver;
1614
use WPGraphQL\WooCommerce\Data\Connection\Order_Connection_Resolver;
1715

1816
/**
@@ -99,8 +97,8 @@ public static function register_connections() {
9997
/**
10098
* Returns order connection filter by customer.
10199
*
102-
* @param Order_Connection_Resolver $resolver Connection resolver.
103-
* @param \WC_Customer $customer Customer object of querying user.
100+
* @param \WPGraphQL\WooCommerce\Data\Connection\Order_Connection_Resolver $resolver Connection resolver.
101+
* @param \WC_Customer $customer Customer object of querying user.
104102
*
105103
* @return array
106104
*/
@@ -129,8 +127,8 @@ private static function get_customer_order_connection( $resolver, $customer ) {
129127
/**
130128
* Returns refund connection filter by customer.
131129
*
132-
* @param Order_Connection_Resolver $resolver Connection resolver.
133-
* @param \WC_Customer $customer Customer object of querying user.
130+
* @param \WPGraphQL\WooCommerce\Data\Connection\Order_Connection_Resolver $resolver Connection resolver.
131+
* @param \WC_Customer $customer Customer object of querying user.
134132
*
135133
* @return array
136134
*/

includes/connection/class-posts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
use GraphQL\Type\Definition\ResolveInfo;
1313
use WPGraphQL\AppContext;
14-
use WPGraphQL\Type\Connection\PostObjects;
1514
use WPGraphQL\Data\Connection\PostObjectConnectionResolver;
15+
use WPGraphQL\Type\Connection\PostObjects;
1616

1717
/**
1818
* Class - Posts

includes/connection/class-products.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
use GraphQL\Type\Definition\ResolveInfo;
1313
use WPGraphQL\AppContext;
14-
use WPGraphQL\WooCommerce\WP_GraphQL_WooCommerce;
1514
use WPGraphQL\Data\Connection\PostObjectConnectionResolver;
15+
use WPGraphQL\WooCommerce\WP_GraphQL_WooCommerce;
1616

1717
/**
1818
* Class - Products
@@ -379,9 +379,9 @@ public static function get_connection_config( $args = [] ): array {
379379
/**
380380
* Bypass arg sanization in Post Object Connection Resolver.
381381
*
382-
* @param array $args Sanitized GraphQL args passed to the resolver.
383-
* @param PostObjectConnectionResolver $connection_resolver Instance of the ConnectionResolver.
384-
* @param array $all_args array of arguments input in the field as part of the GraphQL query.
382+
* @param array $args Sanitized GraphQL args passed to the resolver.
383+
* @param \WPGraphQL\Data\Connection\PostObjectConnectionResolver $connection_resolver Instance of the ConnectionResolver.
384+
* @param array $all_args array of arguments input in the field as part of the GraphQL query.
385385
386386
* @return array
387387
*/
@@ -392,10 +392,10 @@ public static function bypass_get_args_sanitization( $args, $connection_resolver
392392
/**
393393
* Undocumented function
394394
*
395-
* @param PostObjectConnectionResolver $resolver Connection resolver instance.
396-
* @param array $args Connection provided args.
395+
* @param \WPGraphQL\Data\Connection\PostObjectConnectionResolver $resolver Connection resolver instance.
396+
* @param array $args Connection provided args.
397397
*
398-
* @return PostObjectConnectionResolver
398+
* @return \WPGraphQL\Data\Connection\PostObjectConnectionResolver
399399
*/
400400
public static function set_ordering_query_args( $resolver, $args ) {
401401
$backward = isset( $args['last'] ) ? true : false;
@@ -578,13 +578,13 @@ public static function get_connection_args(): array {
578578
* This allows plugins/themes to hook in and alter what $args should be allowed to be passed
579579
* from a GraphQL Query to the WP_Query
580580
*
581-
* @param array $query_args The mapped query arguments.
582-
* @param array $args Query "where" args.
583-
* @param mixed $source The query results for a query calling this.
584-
* @param array $all_args All of the arguments for the query (not just the "where" args).
585-
* @param AppContext $context The AppContext object.
586-
* @param ResolveInfo $info The ResolveInfo object.
587-
* @param mixed|string|array $post_type The post type for the query.
581+
* @param array $query_args The mapped query arguments.
582+
* @param array $args Query "where" args.
583+
* @param mixed $source The query results for a query calling this.
584+
* @param array $all_args All of the arguments for the query (not just the "where" args).
585+
* @param \WPGraphQL\AppContext $context The AppContext object.
586+
* @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object.
587+
* @param mixed|string|array $post_type The post type for the query.
588588
*
589589
* @return array Query arguments.
590590
*/
@@ -882,8 +882,8 @@ public static function map_input_fields_to_wp_query( $query_args, $args, $source
882882
* @param array $where_args Query "where" args
883883
* @param mixed $source The query results for a query calling this
884884
* @param array $all_args All of the arguments for the query (not just the "where" args)
885-
* @param AppContext $context The AppContext object
886-
* @param ResolveInfo $info The ResolveInfo object
885+
* @param \WPGraphQL\AppContext $context The AppContext object
886+
* @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object
887887
* @param mixed|string|array $post_type The post type for the query
888888
*/
889889
$query_args = apply_filters_deprecated(

0 commit comments

Comments
 (0)