Skip to content

Commit

Permalink
fix: initialize arrays before using (#765)
Browse files Browse the repository at this point in the history
* fix!: update deps to required versions

* fix; initialize arrays before using
  • Loading branch information
justlevine committed Jul 19, 2023
1 parent 58fbce7 commit 4502bcd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public function get_query_args() {
/**
* Prepare for later use
*/
$last = ! empty( $this->args['last'] ) ? $this->args['last'] : null;
$last = ! empty( $this->args['last'] ) ? $this->args['last'] : null;
$query_args = [];

/**
* Set the $query_args based on various defaults and primary input $args
Expand Down
3 changes: 3 additions & 0 deletions includes/mutation/class-checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ public static function mutate_and_get_payload() {
*/
do_action( 'graphql_woocommerce_before_checkout', $args, $input, $context, $info );

// We define this now and pass it as a reference.
$results = [];

$order_id = Checkout_Mutation::process_checkout( $args, $input, $context, $info, $results );

$order = \WC_Order_Factory::get_order( $order_id );
Expand Down
3 changes: 3 additions & 0 deletions wp-graphql-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ function dependencies_not_ready( &$deps = [] ) {
* @return void
*/
function init() {
// We define this now and pass it as a reference.
$not_ready = [];

if ( empty( dependencies_not_ready( $not_ready ) ) ) {
require_once get_includes_directory() . 'class-wp-graphql-woocommerce.php';
WP_GraphQL_WooCommerce::instance();
Expand Down

0 comments on commit 4502bcd

Please sign in to comment.