WordPress at a glance
function is not described

PHPMailer\PHPMailer

SMTP::quit() public WP 1.0

Send an SMTP QUIT command. Closes the socket if there is no error or the $close_on_error argument is true. Implements from RFC 821: QUIT <CRLF>.

{} It's a method of the class: SMTP{}

No Hooks.

Return

true|false.

Usage

$SMTP = new SMTP();
$SMTP->quit( $close_on_error );
$close_on_error(true|false)
Should the connection close if an error occurs?

Code of SMTP::quit() WP 5.7.2

<?php
public function quit($close_on_error = true)
{
    $noerror = $this->sendCommand('QUIT', 'QUIT', 221);
    $err = $this->error; //Save any error
    if ($noerror || $close_on_error) {
        $this->close();
        $this->error = $err; //Restore any error from the quit command
    }

    return $noerror;
}