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

Wrong docblock parsed #230

Open
kkmuffme opened this issue May 25, 2022 · 0 comments
Open

Wrong docblock parsed #230

kkmuffme opened this issue May 25, 2022 · 0 comments

Comments

@kkmuffme
Copy link

public function cancel_action( $action_id ) {
        /** @var \wpdb $wpdb */
        global $wpdb;
        
        $updated = $wpdb->update(
	        $wpdb->actionscheduler_actions,
	        array( 'status' => self::STATUS_CANCELED ),
	        array( 'action_id' => $action_id ),
	        array( '%s' ),
	        array( '%d' )
        );
        if ( empty( $updated ) ) {
	        /* translators: %s: action ID */
	        throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) );
        }
        do_action( 'action_scheduler_canceled_action', $action_id );
}

it assigns the /** @var \wpdb $wpdb */ docblock to the do_action( 'action_scheduler_canceled_action', $action_id ); which is completely wrong.

If type is not FuncCall/Return_/Variable/Echo_ it must reset the last_doc to null to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant