Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AbstractHttpTransport.php

class AbstractHttpTransport

@author Victor Bocharsky <victor@symfonycasts.com>

Hierarchy

  • class \Symfony\Component\Mailer\Transport\AbstractTransport implements \Symfony\Component\Mailer\Transport\TransportInterface
    • class \Symfony\Component\Mailer\Transport\AbstractHttpTransport extends \Symfony\Component\Mailer\Transport\AbstractTransport

Expanded class hierarchy of AbstractHttpTransport

File

vendor/symfony/mailer/Transport/AbstractHttpTransport.php, line 25

Namespace

Symfony\Component\Mailer\Transport
View source
abstract class AbstractHttpTransport extends AbstractTransport {
    protected ?string $host = null;
    protected ?int $port = null;
    public function __construct(?HttpClientInterface $client = null, ?EventDispatcherInterface $dispatcher = null, ?LoggerInterface $logger = null) {
        if (null === $client) {
            if (!class_exists(HttpClient::class)) {
                throw new \LogicException(\sprintf('You cannot use "%s" as the HttpClient component is not installed. Try running "composer require symfony/http-client".', __CLASS__));
            }
            $this->client = HttpClient::create();
        }
        parent::__construct($dispatcher, $logger);
    }
    
    /**
     * @return $this
     */
    public function setHost(?string $host) : static {
        $this->host = $host;
        return $this;
    }
    
    /**
     * @return $this
     */
    public function setPort(?int $port) : static {
        $this->port = $port;
        return $this;
    }
    protected abstract function doSendHttp(SentMessage $message) : ResponseInterface;
    protected function doSend(SentMessage $message) : void {
        try {
            $response = $this->doSendHttp($message);
            $message->appendDebug($response->getInfo('debug') ?? '');
        } catch (HttpTransportException $e) {
            $e->appendDebug($e->getResponse()
                ->getInfo('debug') ?? '');
            throw $e;
        }
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
AbstractHttpTransport::$host protected property
AbstractHttpTransport::$port protected property
AbstractHttpTransport::doSend protected function Overrides AbstractTransport::doSend
AbstractHttpTransport::doSendHttp abstract protected function 1
AbstractHttpTransport::setHost public function
AbstractHttpTransport::setPort public function
AbstractHttpTransport::__construct public function Overrides AbstractTransport::__construct
AbstractTransport::$lastSent private property
AbstractTransport::$logger private property
AbstractTransport::$rate private property
AbstractTransport::checkThrottling private function
AbstractTransport::getLogger protected function
AbstractTransport::send public function Overrides TransportInterface::send 2
AbstractTransport::setMaxPerSecond public function Sets the maximum number of messages to send per second (0 to disable).
AbstractTransport::stringifyAddresses protected function
RSS feed
Powered by Drupal