Skip to content

Commit 4502bcd

Browse files
authored
fix: initialize arrays before using (#765)
* fix!: update deps to required versions * fix; initialize arrays before using
1 parent 58fbce7 commit 4502bcd

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

includes/data/connection/class-customer-connection-resolver.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ public function get_query_args() {
4949
/**
5050
* Prepare for later use
5151
*/
52-
$last = ! empty( $this->args['last'] ) ? $this->args['last'] : null;
52+
$last = ! empty( $this->args['last'] ) ? $this->args['last'] : null;
53+
$query_args = [];
5354

5455
/**
5556
* Set the $query_args based on various defaults and primary input $args

includes/mutation/class-checkout.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ public static function mutate_and_get_payload() {
145145
*/
146146
do_action( 'graphql_woocommerce_before_checkout', $args, $input, $context, $info );
147147

148+
// We define this now and pass it as a reference.
149+
$results = [];
150+
148151
$order_id = Checkout_Mutation::process_checkout( $args, $input, $context, $info, $results );
149152

150153
$order = \WC_Order_Factory::get_order( $order_id );

wp-graphql-woocommerce.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ function dependencies_not_ready( &$deps = [] ) {
115115
* @return void
116116
*/
117117
function init() {
118+
// We define this now and pass it as a reference.
119+
$not_ready = [];
120+
118121
if ( empty( dependencies_not_ready( $not_ready ) ) ) {
119122
require_once get_includes_directory() . 'class-wp-graphql-woocommerce.php';
120123
WP_GraphQL_WooCommerce::instance();

0 commit comments

Comments
 (0)