ezcMailImapTransport::responseType PHP Method

responseType() protected method

Returns one of the following: - {@link RESPONSE_OK} - {@link RESPONSE_NO} - {@link RESPONSE_BAD} - {@link RESPONSE_UNTAGGED} - {@link RESPONSE_FEEDBACK}
protected responseType ( string $line ) : integer
$line string
return integer
    protected function responseType($line)
    {
        if (strpos($line, 'OK ') !== false && strpos($line, 'OK ') == 6) {
            return self::RESPONSE_OK;
        }
        if (strpos($line, 'NO ') !== false && strpos($line, 'NO ') == 6) {
            return self::RESPONSE_NO;
        }
        if (strpos($line, 'BAD ') !== false && strpos($line, 'BAD ') == 6) {
            return self::RESPONSE_BAD;
        }
        if (strpos($line, '* ') !== false && strpos($line, '* ') == 0) {
            return self::RESPONSE_UNTAGGED;
        }
        if (strpos($line, '+ ') !== false && strpos($line, '+ ') == 0) {
            return self::RESPONSE_FEEDBACK;
        }
        throw new ezcMailTransportException("Unrecognized IMAP response in line: {$line}");
    }