class CanaryTransportFactory

Same name and namespace in other branches
  1. main core/modules/mailer/tests/modules/mailer_transport_factory_kernel_test/src/Transport/CanaryTransportFactory.php \Drupal\mailer_transport_factory_kernel_test\Transport\CanaryTransportFactory

A transport factory only used to test the transport factory adapter.

Hierarchy

Expanded class hierarchy of CanaryTransportFactory

File

core/modules/mailer/tests/modules/mailer_transport_factory_kernel_test/src/Transport/CanaryTransportFactory.php, line 16

Namespace

Drupal\mailer_transport_factory_kernel_test\Transport
View source
class CanaryTransportFactory extends AbstractTransportFactory implements TransportFactoryInterface {
  protected function getSupportedSchemes() : array {
    return [
      'drupal.test-canary',
    ];
  }
  
  /**
   * {@inheritdoc}
   */
  public function create(Dsn $dsn) : TransportInterface {
    if ($dsn->getScheme() === 'drupal.test-canary') {
      return new CanaryTransport($this->dispatcher, $this->logger);
    }
    throw new UnsupportedSchemeException($dsn, 'test_canary', $this->getSupportedSchemes());
  }

}

Members

Title Sort descending Modifiers Object type Summary
CanaryTransportFactory::create public function
CanaryTransportFactory::getSupportedSchemes protected function

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.