Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use fully-qualified class names for PHPDoc types #767

Merged
merged 3 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
=== WP GraphQL WooCommerce ===
Contributors: kidunot89, ranaaterning, jasonbahl, saleebm
Tags: GraphQL, WooCommerce, WPGraphQL
Requires at least: 4.9
Requires at least: 5.9
Tested up to: 6.2
Requires PHP: 7.1
Requires WooCommerce: 4.8.0
Requires PHP: 7.2
Requires WooCommerce: 7.5.0
Requires WPGraphQL: 1.14.0+
Works with WPGraphQL-JWT-Authentication: 0.7.0+
Stable tag: 0.14.1
Expand Down
7 changes: 2 additions & 5 deletions access-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
* @since 0.0.1
*/

use WPGraphQL\WooCommerce\Utils\QL_Session_Handler;
use WPGraphQL\WooCommerce\Utils\Transfer_Session_Handler;

if ( ! function_exists( 'wc_graphql_starts_with' ) ) {
/**
* Checks if source string starts with the target string
Expand Down Expand Up @@ -287,7 +284,7 @@ function woographql_get_session_uid() {
/**
* Session Handler
*
* @var QL_Session_Handler|Transfer_Session_Handler $session
* @var \WPGraphQL\WooCommerce\Utils\QL_Session_Handler|\WPGraphQL\WooCommerce\Utils\Transfer_Session_Handler $session
*/
$session = WC()->session;
return $session->get_customer_id();
Expand All @@ -304,7 +301,7 @@ function woographql_get_session_token() {
/**
* Session Handler
*
* @var QL_Session_Handler|Transfer_Session_Handler $session
* @var \WPGraphQL\WooCommerce\Utils\QL_Session_Handler|\WPGraphQL\WooCommerce\Utils\Transfer_Session_Handler $session
*/
$session = WC()->session;
return $session->get_client_session_id();
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
}
],
"require": {
"php": ">=7.1.0",
"php": ">=7.2",
"firebase/php-jwt": "^6.1.0"
},
"require-dev": {
"automattic/vipwpcs": "^2.3",
"axepress/wp-graphql-stubs": "^1.14",
"php-stubs/woocommerce-stubs": "^7.7",
"axepress/wp-graphql-stubs": "1.14.0",
"php-stubs/woocommerce-stubs": "7.5.0",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan": "^1.10",
"squizlabs/php_codesniffer": "^3.5",
Expand Down
38 changes: 19 additions & 19 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion includes/class-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct() {
/**
* Registers the WooGraphQL Settings tab.
*
* @param Settings $manager Settings Manager.
* @param \WPGraphQL\Admin\Settings\Settings $manager Settings Manager.
* @return void
*/
public function register_settings( Settings $manager ) {
Expand Down
6 changes: 3 additions & 3 deletions includes/class-core-schema-filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
namespace WPGraphQL\WooCommerce;

use GraphQL\Error\UserError;
use WPGraphQL\WooCommerce\Data\Loader\WC_Customer_Loader;
use WPGraphQL\WooCommerce\Data\Factory;
use WPGraphQL\WooCommerce\Data\Loader\WC_CPT_Loader;
use WPGraphQL\WooCommerce\Data\Loader\WC_Customer_Loader;
use WPGraphQL\WooCommerce\Data\Loader\WC_Db_Loader;
use WPGraphQL\WooCommerce\Data\Factory;
use WPGraphQL\WooCommerce\WP_GraphQL_WooCommerce as WooGraphQL;

/**
Expand Down Expand Up @@ -360,7 +360,7 @@ public static function inject_union_type_resolver( $type, $value, $wp_union ) {
* @param \WPGraphQL\Type\WPObjectType|null $type Type be resolve to.
* @param mixed $value Object for which the type is being resolve config.
*
* @throws UserError Invalid product type received.
* @throws \GraphQL\Error\UserError Invalid product type received.
*
* @return \WPGraphQL\Type\WPObjectType|null
*/
Expand Down
4 changes: 1 addition & 3 deletions includes/class-jwt-auth-schema-filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

use GraphQL\Error\UserError;
use WPGraphQL\WooCommerce\Model\Customer;
use WPGraphQL\WooCommerce\Utils\QL_Session_Handler;
use WPGraphQL\WooCommerce\Utils\Transfer_Session_Handler;

/**
* Class JWT_Auth_Schema_Filters
Expand Down Expand Up @@ -142,7 +140,7 @@ public static function add_customer_to_login_payload() {
/**
* Session Handler.
*
* @var QL_Session_Handler $session
* @var \WPGraphQL\WooCommerce\Utils\QL_Session_Handler $session
*/
$session = \WC()->session;

Expand Down
6 changes: 3 additions & 3 deletions includes/class-wp-graphql-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ final class WP_GraphQL_WooCommerce {
/**
* Stores the instance of the WP_GraphQL_WooCommerce class
*
* @var null|WP_GraphQL_WooCommerce The one true WP_GraphQL_WooCommerce
* @var null|\WPGraphQL\WooCommerce\WP_GraphQL_WooCommerce The one true WP_GraphQL_WooCommerce
*/
private static $instance = null;

/**
* Returns a WP_GraphQL_WooCommerce Instance.
*
* @return WP_GraphQL_WooCommerce
* @return \WPGraphQL\WooCommerce\WP_GraphQL_WooCommerce
*/
public static function instance() {
if ( is_null( self::$instance ) ) {
Expand All @@ -40,7 +40,7 @@ public static function instance() {
/**
* Fire off init action
*
* @param WP_GraphQL_WooCommerce $instance The instance of the WP_GraphQL_WooCommerce class
* @param \WPGraphQL\WooCommerce\WP_GraphQL_WooCommerce $instance The instance of the WP_GraphQL_WooCommerce class
*/
do_action( 'graphql_woocommerce_init', self::$instance );

Expand Down
21 changes: 9 additions & 12 deletions includes/connection/class-coupons.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@

namespace WPGraphQL\WooCommerce\Connection;

use GraphQL\Error\UserError;
use GraphQL\Type\Definition\ResolveInfo;
use WPGraphQL\AppContext;
use WPGraphQL\Data\Connection\PostObjectConnectionResolver;

/**
Expand Down Expand Up @@ -101,13 +98,13 @@ public static function get_connection_args(): array {
* This allows plugins/themes to hook in and alter what $args should be allowed to be passed
* from a GraphQL Query to the WP_Query
*
* @param array $query_args The mapped query arguments.
* @param array $where_args Query "where" args.
* @param mixed $source The query results for a query calling this.
* @param array $args All of the arguments for the query (not just the "where" args).
* @param AppContext $context The AppContext object.
* @param ResolveInfo $info The ResolveInfo object.
* @param mixed|string|array $post_type The post type for the query.
* @param array $query_args The mapped query arguments.
* @param array $where_args Query "where" args.
* @param mixed $source The query results for a query calling this.
* @param array $args All of the arguments for the query (not just the "where" args).
* @param \WPGraphQL\AppContext $context The AppContext object.
* @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object.
* @param mixed|string|array $post_type The post type for the query.
*
* @return array Query arguments.
*/
Expand Down Expand Up @@ -141,8 +138,8 @@ public static function map_input_fields_to_wp_query( $query_args, $where_args, $
* @param array $where_args Query "where" args
* @param mixed $source The query results for a query calling this
* @param array $all_args All of the arguments for the query (not just the "where" args)
* @param AppContext $context The AppContext object
* @param ResolveInfo $info The ResolveInfo object
* @param \WPGraphQL\AppContext $context The AppContext object
* @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object
*/
$query_args = apply_filters(
'graphql_map_input_fields_to_coupon_query',
Expand Down
29 changes: 14 additions & 15 deletions includes/connection/class-customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

use GraphQL\Type\Definition\ResolveInfo;
use WPGraphQL\AppContext;
use WPGraphQL\Data\Connection\AbstractConnectionResolver;
use WPGraphQL\Data\Connection\UserConnectionResolver;
use WPGraphQL\WooCommerce\Model\Customer;

Expand Down Expand Up @@ -126,12 +125,12 @@ public static function get_connection_args(): array {
* This allows plugins/themes to hook in and alter what $args should be allowed to be passed
* from a GraphQL Query to the WP_Query
*
* @param array $query_args The mapped query arguments.
* @param array $where_args Query "where" args.
* @param mixed $source The query results for a query calling this.
* @param array $args All of the arguments for the query (not just the "where" args).
* @param AppContext $context The AppContext object.
* @param ResolveInfo $info The ResolveInfo object.
* @param array $query_args The mapped query arguments.
* @param array $where_args Query "where" args.
* @param mixed $source The query results for a query calling this.
* @param array $args All of the arguments for the query (not just the "where" args).
* @param \WPGraphQL\AppContext $context The AppContext object.
* @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object.
*
* @return array Query arguments.
*/
Expand Down Expand Up @@ -173,12 +172,12 @@ public static function map_input_fields_to_wp_query( $query_args, $where_args, $
* This allows plugins/themes to hook in and alter what $args should be allowed to be passed
* from a GraphQL Query to the WP_Query
*
* @param array $args The mapped query arguments
* @param array $where_args Query "where" args
* @param mixed $source The query results for a query calling this
* @param array $all_args All of the arguments for the query (not just the "where" args)
* @param AppContext $context The AppContext object
* @param ResolveInfo $info The ResolveInfo object
* @param array $args The mapped query arguments
* @param array $where_args Query "where" args
* @param mixed $source The query results for a query calling this
* @param array $all_args All of the arguments for the query (not just the "where" args)
* @param \WPGraphQL\AppContext $context The AppContext object
* @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object
*/
$query_args = apply_filters(
'graphql_map_input_fields_to_customer_query',
Expand All @@ -197,8 +196,8 @@ public static function map_input_fields_to_wp_query( $query_args, $where_args, $
* Temporary function until necessary functionality
* has been added to the UserConnectionResolver
*
* @param array $connection Resolved connection.
* @param AbstractConnectionResolver $resolver Resolver class.
* @param array $connection Resolved connection.
* @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $resolver Resolver class.
*
* @return array
*/
Expand Down
10 changes: 4 additions & 6 deletions includes/connection/class-orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@

namespace WPGraphQL\WooCommerce\Connection;

use Automattic\WooCommerce\Utilities\OrderUtil;
use GraphQL\Type\Definition\ResolveInfo;
use WPGraphQL\AppContext;
use WPGraphQL\Data\Connection\PostObjectConnectionResolver;
use WPGraphQL\WooCommerce\Data\Connection\Order_Connection_Resolver;

/**
Expand Down Expand Up @@ -99,8 +97,8 @@ public static function register_connections() {
/**
* Returns order connection filter by customer.
*
* @param Order_Connection_Resolver $resolver Connection resolver.
* @param \WC_Customer $customer Customer object of querying user.
* @param \WPGraphQL\WooCommerce\Data\Connection\Order_Connection_Resolver $resolver Connection resolver.
* @param \WC_Customer $customer Customer object of querying user.
*
* @return array
*/
Expand Down Expand Up @@ -129,8 +127,8 @@ private static function get_customer_order_connection( $resolver, $customer ) {
/**
* Returns refund connection filter by customer.
*
* @param Order_Connection_Resolver $resolver Connection resolver.
* @param \WC_Customer $customer Customer object of querying user.
* @param \WPGraphQL\WooCommerce\Data\Connection\Order_Connection_Resolver $resolver Connection resolver.
* @param \WC_Customer $customer Customer object of querying user.
*
* @return array
*/
Expand Down
2 changes: 1 addition & 1 deletion includes/connection/class-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

use GraphQL\Type\Definition\ResolveInfo;
use WPGraphQL\AppContext;
use WPGraphQL\Type\Connection\PostObjects;
use WPGraphQL\Data\Connection\PostObjectConnectionResolver;
use WPGraphQL\Type\Connection\PostObjects;

/**
* Class - Posts
Expand Down
Loading