Skip to content

Wrong docblock parsed #230

Open
Open

Description

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions