Pantheon\Terminus\Commands\MachineToken\DeleteCommand::delete PHP Method

delete() public method

Remove a machine token from the logged-in user's account
public delete ( string $machine_token_id )
$machine_token_id string The ID of the machine token to be deleted
    public function delete($machine_token_id)
    {
        // Find the token. Will throw an exception if it doesn't exist.
        $machine_token = $this->session()->getUser()->getMachineTokens()->get($machine_token_id);
        $name = $machine_token->get('device_name');
        $this->log()->notice('Deleting {token} ...', ['token' => $name]);
        $machine_token->delete();
        $this->log()->notice('Deleted {token}!', ['token' => $name]);
    }
DeleteCommand