Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit de61758

Browse files
committed
Resolve git conflict
2 parents 6069b69 + 87b709c commit de61758

File tree

11 files changed

+52
-38
lines changed

11 files changed

+52
-38
lines changed

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
vendor/
22
phpcs.xml
33
phpunit.xml
4-
composer.lock
4+
composer.lock

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![Latest Stable Version](https://img.shields.io/packagist/v/ddrv/mailer.svg?style=flat-square)](https://packagist.org/packages/ddrv/mailer)
22
[![Total Downloads](https://img.shields.io/packagist/dt/ddrv/mailer.svg?style=flat-square)](https://packagist.org/packages/ddrv/mailer/stats)
3-
[![License](https://img.shields.io/packagist/l/ddrv/mailer.svg?style=flat-square)](https://github.com/ddrv/mailer/blob/master/LICENSE)
3+
[![License](https://img.shields.io/packagist/l/ddrv/mailer.svg?style=flat-square)](https://github.com/ddrv/php-mailer/blob/master/LICENSE)
44
[![PHP](https://img.shields.io/packagist/php-v/ddrv/mailer.svg?style=flat-square)](https://php.net)
55

66

@@ -223,4 +223,4 @@ $transport = TransportFactory::make('file:////path/to/mail/files');
223223
// fake
224224
$transport = TransportFactory::make('fake://localhost');
225225

226-
```
226+
```

‎src/Exception/RecipientsListEmptyException.php‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
namespace Ddrv\Mailer\Exception;
44

55
use Exception;
6-
use Throwable;
76

87
final class RecipientsListEmptyException extends Exception
98
{
109

11-
public function __construct(Throwable$previous = null)
10+
public function __construct()
1211
{
13-
parent::__construct("recipients list is empty", 1, $previous);
12+
parent::__construct("recipients list is empty", 1);
1413
}
1514
}

‎src/Mailer.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
namespace Ddrv\Mailer;
44

5-
use Throwable;
5+
use Exception;
66

77
final class Mailer
88
{
99

10-
const MAILER_VERSION = "4.1.0";
10+
const MAILER_VERSION = "4.1.4";
1111

1212
/**
1313
* @var SpoolInterface
@@ -83,7 +83,7 @@ private function sendMail(Message $message, $personal = false, $priority = 1)
8383
ksort($params);
8484
try {
8585
call_user_func_array($fn, $params);
86-
} catch (Throwable $e) {
86+
} catch (Exception $e) {
8787
}
8888
}
8989
return $this;

‎src/Transport/FakeTransport.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
final class FakeTransport implements TransportInterface
1111
{
1212
/**
13-
* @var callable
13+
* @var Closure
1414
*/
1515
private $logger;
1616

‎src/Transport/FileTransport.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
final class FileTransport implements TransportInterface
1111
{
1212
/**
13-
* @var callable
13+
* @var Closure
1414
*/
1515
private $logger;
1616

‎src/Transport/SendmailTransport.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ final class SendmailTransport implements TransportInterface
1616
private $options;
1717

1818
/**
19-
* @var callable
19+
* @var Closure
2020
*/
2121
private $logger;
2222

‎src/Transport/SmtpTransport.php‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class SmtpTransport implements TransportInterface
2525
private $email;
2626

2727
/**
28-
* @var callable
28+
* @var Closure
2929
*/
3030
private $logger;
3131

@@ -152,7 +152,9 @@ private function smtpCommand($command)
152152

153153
public function __destruct()
154154
{
155-
$this->smtpCommand("QUIT");
156-
fclose($this->socket);
155+
if (is_resource($this->socket)) {
156+
$this->smtpCommand("QUIT");
157+
fclose($this->socket);
158+
}
157159
}
158160
}

‎tests/Support/Factory/MessageFactory.php‎

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,41 @@ public function __construct()
2525
public function generateMessage($toQuantity, $ccQuantity = 0, $bccQuantity = 0)
2626
{
2727
$toQuantity = (int)$toQuantity;
28-
if ($toQuantity < 1) $toQuantity = 1;
29-
if ($toQuantity > 20) $toQuantity = 20;
28+
if ($toQuantity < 1) {
29+
$toQuantity = 1;
30+
}
31+
if ($toQuantity > 20) {
32+
$toQuantity = 20;
33+
}
3034
$ccQuantity = (int)$ccQuantity;
31-
if ($ccQuantity < 0) $ccQuantity = 0;
32-
if ($ccQuantity > 20) $ccQuantity = 20;
35+
if ($ccQuantity < 0) {
36+
$ccQuantity = 0;
37+
}
38+
if ($ccQuantity > 20) {
39+
$ccQuantity = 20;
40+
}
3341
$bccQuantity = (int)$bccQuantity;
34-
if ($bccQuantity < 0) $bccQuantity = 0;
35-
if ($bccQuantity > 20) $bccQuantity = 20;
42+
if ($bccQuantity < 0) {
43+
$bccQuantity = 0;
44+
}
45+
if ($bccQuantity > 20) {
46+
$bccQuantity = 20;
47+
}
3648
$all = $toQuantity + $ccQuantity + $bccQuantity;
3749
$recipients = $this->generateRecipients($all);
3850

3951
$subject = $this->faker->text(50);
4052
$text = $this->faker->randomHtml();
4153
$message = new Message($subject, $text, true);
42-
for ($n=1; $n<=$toQuantity; $n++) {
54+
for ($n = 1; $n <= $toQuantity; $n++) {
4355
$recipient = array_shift($recipients);
4456
$message->addTo($recipient["email"], $recipient["name"]);
4557
}
46-
for ($n=1; $n<=$ccQuantity; $n++) {
58+
for ($n = 1; $n <= $ccQuantity; $n++) {
4759
$recipient = array_shift($recipients);
4860
$message->addCc($recipient["email"], $recipient["name"]);
4961
}
50-
for ($n=1; $n<=$bccQuantity; $n++) {
62+
for ($n = 1; $n <= $bccQuantity; $n++) {
5163
$recipient = array_shift($recipients);
5264
$message->addBcc($recipient["email"], $recipient["name"]);
5365
}
@@ -58,8 +70,12 @@ public function generateMessage($toQuantity, $ccQuantity = 0, $bccQuantity = 0)
5870
public function generateRecipients($quantity)
5971
{
6072
$quantity = (int)$quantity;
61-
if ($quantity < 1) $quantity = 1;
62-
if ($quantity > 100) $quantity = 100;
73+
if ($quantity < 1) {
74+
$quantity = 1;
75+
}
76+
if ($quantity > 100) {
77+
$quantity = 100;
78+
}
6379
$recipients = array();
6480
do {
6581
$email = $this->faker->email;
@@ -72,4 +88,4 @@ public function generateRecipients($quantity)
7288
} while (count($recipients) < $quantity);
7389
return $recipients;
7490
}
75-
}
91+
}

‎tests/Support/Mock/Transport/MockTransport.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
final class MockTransport implements TransportInterface
1111
{
1212
/**
13-
* @var callable
13+
* @var Closure
1414
*/
1515
private $logger;
1616

@@ -47,4 +47,4 @@ public function count()
4747
{
4848
return count($this->messages);
4949
}
50-
}
50+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /