mirror of
https://github.com/itflow-org/itflow
synced 2026-03-12 00:34:52 +00:00
Add new optional beta email parser thats based on ImapEngine instead of Webklex
This commit is contained in:
48
plugins/vendor/directorytree/imapengine/src/Exceptions/ImapCommandException.php
vendored
Normal file
48
plugins/vendor/directorytree/imapengine/src/Exceptions/ImapCommandException.php
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace DirectoryTree\ImapEngine\Exceptions;
|
||||
|
||||
use DirectoryTree\ImapEngine\Connection\ImapCommand;
|
||||
use DirectoryTree\ImapEngine\Connection\Responses\Response;
|
||||
|
||||
class ImapCommandException extends Exception
|
||||
{
|
||||
/**
|
||||
* The IMAP response.
|
||||
*/
|
||||
protected Response $response;
|
||||
|
||||
/**
|
||||
* The failed IMAP command.
|
||||
*/
|
||||
protected ImapCommand $command;
|
||||
|
||||
/**
|
||||
* Make a new instance from a failed command and response.
|
||||
*/
|
||||
public static function make(ImapCommand $command, Response $response): static
|
||||
{
|
||||
$exception = new static(sprintf('IMAP command "%s" failed. Response: "%s"', $command, $response));
|
||||
|
||||
$exception->command = $command;
|
||||
$exception->response = $response;
|
||||
|
||||
return $exception;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the failed IMAP command.
|
||||
*/
|
||||
public function command(): ImapCommand
|
||||
{
|
||||
return $this->command;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the IMAP response.
|
||||
*/
|
||||
public function response(): Response
|
||||
{
|
||||
return $this->response;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user