Skip to content
Permalink
Browse files

renamed Nette\Mail\IMailer -> Mailer, added class alias

  • Loading branch information...
dg committed Jun 3, 2019
1 parent 102ff80 commit d109c9ea4ecbd7dcbf803381048632b83f9d7a2e
Showing with 22 additions and 11 deletions.
  1. +2 βˆ’1 composer.json
  2. +1 βˆ’1 readme.md
  3. +1 βˆ’1 src/Bridges/MailDI/MailExtension.php
  4. +5 βˆ’5 src/Mail/FallbackMailer.php
  5. +1 βˆ’1 src/Mail/{IMailer.php β†’ Mailer.php}
  6. +1 βˆ’1 src/Mail/SendmailMailer.php
  7. +1 βˆ’1 src/Mail/SmtpMailer.php
  8. +10 βˆ’0 src/compatibility.php
@@ -31,7 +31,8 @@
"ext-fileinfo": "to detect type of attached files"
},
"autoload": {
"classmap": ["src/"]
"classmap": ["src/"],
"files": ["src/compatibility.php"]
},
"minimum-stability": "dev",
"extra": {
@@ -107,4 +107,4 @@ $mailer = new Nette\Mail\SmtpMailer([
$mailer->send($mail);
```

You can also create your own mailer - it's a class implementing Nette\Mail\IMailer interface.
You can also create your own mailer - it's a class implementing Nette\Mail\Mailer interface.
@@ -40,7 +40,7 @@ public function loadConfiguration()
$builder = $this->getContainerBuilder();
$mailer = $builder->addDefinition($this->prefix('mailer'))
->setType(Nette\Mail\IMailer::class);
->setType(Nette\Mail\Mailer::class);
if ($this->config['smtp']) {
$mailer->setFactory(Nette\Mail\SmtpMailer::class, [$this->config]);
@@ -12,14 +12,14 @@
use Nette;
class FallbackMailer implements IMailer
class FallbackMailer implements Mailer
{
use Nette\SmartObject;
/** @var callable[] function (FallbackMailer $sender, SendException $e, IMailer $mailer, Message $mail): void */
/** @var callable[] function (FallbackMailer $sender, SendException $e, Mailer $mailer, Message $mail): void */
public $onFailure;
/** @var IMailer[] */
/** @var Mailer[] */
private $mailers;
/** @var int */
@@ -30,7 +30,7 @@ class FallbackMailer implements IMailer
/**
* @param IMailer[] $mailers
* @param Mailer[] $mailers
* @param int $retryWaitTime in miliseconds
*/
public function __construct(array $mailers, int $retryCount = 3, int $retryWaitTime = 1000)
@@ -77,7 +77,7 @@ public function send(Message $mail): void
/**
* @return static
*/
public function addMailer(IMailer $mailer)
public function addMailer(Mailer $mailer)
{
$this->mailers[] = $mailer;
return $this;
@@ -13,7 +13,7 @@
/**
* Mailer interface.
*/
interface IMailer
interface Mailer
{
/**
@@ -15,7 +15,7 @@
/**
* Sends emails via the PHP internal mail() function.
*/
class SendmailMailer implements IMailer
class SendmailMailer implements Mailer
{
use Nette\SmartObject;
@@ -15,7 +15,7 @@
/**
* Sends emails via the SMTP server.
*/
class SmtpMailer implements IMailer
class SmtpMailer implements Mailer
{
use Nette\SmartObject;
@@ -0,0 +1,10 @@
<?php
/**
* This file is part of the Nette Framework (https://nette.org)
* Copyright (c) 2004 David Grudl (https://davidgrudl.com)
*/
declare(strict_types=1);
class_alias(Nette\Mail\Mailer::class, Nette\Mail\IMailer::class);

0 comments on commit d109c9e

Please sign in to comment.
You can’t perform that action at this time.