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 8527409

Browse files
committed
Fix code style.
1 parent 8be8338 commit 8527409

File tree

3 files changed

+36
-20
lines changed

3 files changed

+36
-20
lines changed

‎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+
}

‎tests/Unit/MailerTest.php‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,17 @@ public function testSpoolPersonalSend()
8989
private function generateMessages($quantity)
9090
{
9191
$messages = array();
92-
for ($i=1; $i<=$quantity; $i++) {
93-
$messages[] = $this->factory->generateMessage(rand(1,20), rand(1,20), rand(1,20));
92+
for ($i = 1; $i <= $quantity; $i++) {
93+
$messages[] = $this->factory->generateMessage(rand(1,20), rand(1,20), rand(1,20));
9494
}
9595
return $messages;
9696
}
9797

9898
public static function assertMessage(Message $expected, Message $actual)
9999
{
100-
self::assertSame($expected->getSubject(), $actual->getSubject());
101-
self::assertSame($expected->getBody(), $actual->getBody());
102-
self::assertSame($expected->getHeaders(), $actual->getHeaders());
100+
self::assertSame($expected->getSubject(), $actual->getSubject());
101+
self::assertSame($expected->getBody(), $actual->getBody());
102+
self::assertSame($expected->getHeaders(), $actual->getHeaders());
103103
self::assertSame($expected->getRecipients(), $actual->getRecipients());
104104
}
105-
}
105+
}

0 commit comments

Comments
(0)

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