Skip to content

Commit 03428b8

Browse files
committed
coding style
1 parent 4969ba2 commit 03428b8

20 files changed

+382
-384
lines changed

src/Bridges/MailDI/MailExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function getConfigSchema(): Nette\Schema\Schema
3939
'privateKey' => Expect::string()->required(),
4040
'passPhrase' => Expect::string()->dynamic(),
4141
'testMode' => Expect::bool(false)->dynamic(),
42-
])->castTo('array')
42+
])->castTo('array'),
4343
),
4444
])->castTo('array');
4545
}

src/Mail/DkimSigner.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ protected function computeBodyHash(string $body): string
150150
return base64_encode(
151151
pack(
152152
'H*',
153-
hash('sha256', $body)
154-
)
153+
hash('sha256', $body),
154+
),
155155
);
156156
}
157157

@@ -166,9 +166,7 @@ protected function normalizeNewLines(string $s): string
166166

167167
protected function getSignedHeaders(Message $message): array
168168
{
169-
return array_filter($this->signHeaders, function ($name) use ($message) {
170-
return $message->getHeader($name) !== null;
171-
});
169+
return array_filter($this->signHeaders, fn($name) => $message->getHeader($name) !== null);
172170
}
173171

174172

src/Mail/Message.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public function setHtmlBody(string $html, string $basePath = null)
211211
(["\']?)(?![a-z]+:|[/\#])([^"\'>)\s]+)
212212
|\[\[ ([\w()+./@~-]+) \]\]
213213
#ix',
214-
PREG_OFFSET_CAPTURE
214+
PREG_OFFSET_CAPTURE,
215215
);
216216
foreach (array_reverse($matches) as $m) {
217217
$file = rtrim($basePath, '/\\') . '/' . (isset($m[4]) ? $m[4][0] : urldecode($m[3][0]));
@@ -222,7 +222,7 @@ public function setHtmlBody(string $html, string $basePath = null)
222222
$html,
223223
"{$m[1][0]}{$m[2][0]}cid:{$cids[$file]}",
224224
$m[0][1],
225-
strlen($m[0][0])
225+
strlen($m[0][0]),
226226
);
227227
}
228228
}
@@ -299,7 +299,7 @@ private function createAttachment(
299299
string $file,
300300
?string $content,
301301
?string $contentType,
302-
string $disposition
302+
string $disposition,
303303
): MimePart {
304304
$part = new MimePart;
305305
if ($content === null) {

src/Mail/SmtpMailer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function send(Message $mail): void
123123
foreach (array_merge(
124124
(array) $mail->getHeader('To'),
125125
(array) $mail->getHeader('Cc'),
126-
(array) $mail->getHeader('Bcc')
126+
(array) $mail->getHeader('Bcc'),
127127
) as $email => $name) {
128128
$this->write("RCPT TO:<$email>", [250, 251]);
129129
}
@@ -157,7 +157,7 @@ protected function connect(): void
157157
$error,
158158
$this->timeout,
159159
STREAM_CLIENT_CONNECT,
160-
$this->context
160+
$this->context,
161161
);
162162
if (!$this->connection) {
163163
throw new SmtpException($error ?: error_get_last()['message'], $errno);
@@ -171,7 +171,7 @@ protected function connect(): void
171171
if (!stream_socket_enable_crypto(
172172
$this->connection,
173173
true,
174-
STREAM_CRYPTO_METHOD_TLS_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT
174+
STREAM_CRYPTO_METHOD_TLS_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT,
175175
)) {
176176
throw new SmtpException('Unable to connect via TLS.');
177177
}

tests/Mail/Mail.HtmlBody.phpt

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,27 @@ $mailer = new TestMailer;
2727
$mailer->send($mail);
2828

2929
Assert::match(<<<'EOD'
30-
MIME-Version: 1.0
31-
X-Mailer: Nette Framework
32-
Date: %a%
33-
From: John Doe <[email protected]>
34-
To: Lady Jane <[email protected]>
35-
Subject: Hello Jane!
36-
Message-ID: <%S%@%S%>
37-
Content-Type: multipart/alternative;
38-
boundary="--------%S%"
39-
40-
----------%S%
41-
Content-Type: text/plain; charset=UTF-8
42-
Content-Transfer-Encoding: 8bit
43-
44-
Příliš žluťoučký
45-
kůň
46-
----------%S%
47-
Content-Type: text/html; charset=UTF-8
48-
Content-Transfer-Encoding: 8bit
49-
50-
<b><span>Příliš </span> žluťoučký <br>kůň</b>
51-
----------%S%--
52-
EOD
30+
MIME-Version: 1.0
31+
X-Mailer: Nette Framework
32+
Date: %a%
33+
From: John Doe <[email protected]>
34+
To: Lady Jane <[email protected]>
35+
Subject: Hello Jane!
36+
Message-ID: <%S%@%S%>
37+
Content-Type: multipart/alternative;
38+
boundary="--------%S%"
39+
40+
----------%S%
41+
Content-Type: text/plain; charset=UTF-8
42+
Content-Transfer-Encoding: 8bit
43+
44+
Příliš žluťoučký
45+
kůň
46+
----------%S%
47+
Content-Type: text/html; charset=UTF-8
48+
Content-Transfer-Encoding: 8bit
49+
50+
<b><span>Příliš </span> žluťoučký <br>kůň</b>
51+
----------%S%--
52+
EOD
5353
, TestMailer::$output);

tests/Mail/Mail.HtmlBodyAndLinks.multiline.phpt

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -35,35 +35,35 @@ $mailer = new TestMailer;
3535
$mailer->send($mail);
3636

3737
Assert::match(<<<'EOD'
38-
MIME-Version: 1.0
39-
X-Mailer: Nette Framework
40-
Date: %a%
41-
From: John Doe <[email protected]>
42-
To: Lady Jane <[email protected]>
43-
Subject: Hello Jane!
44-
Message-ID: <%S%@%S%>
45-
Content-Type: multipart/alternative;
46-
boundary="--------%S%"
38+
MIME-Version: 1.0
39+
X-Mailer: Nette Framework
40+
Date: %a%
41+
From: John Doe <[email protected]>
42+
To: Lady Jane <[email protected]>
43+
Subject: Hello Jane!
44+
Message-ID: <%S%@%S%>
45+
Content-Type: multipart/alternative;
46+
boundary="--------%S%"
4747
48-
----------%S%
49-
Content-Type: text/plain; charset=UTF-8
50-
Content-Transfer-Encoding: 8bit
48+
----------%S%
49+
Content-Type: text/plain; charset=UTF-8
50+
Content-Transfer-Encoding: 8bit
5151
52-
Příliš žluťoučký <http://green.example.com>
53-
žlutý kůň <http://horse.example.com>
54-
----------%S%
55-
Content-Type: text/html; charset=UTF-8
56-
Content-Transfer-Encoding: 8bit
52+
Příliš žluťoučký <http://green.example.com>
53+
žlutý kůň <http://horse.example.com>
54+
----------%S%
55+
Content-Type: text/html; charset=UTF-8
56+
Content-Transfer-Encoding: 8bit
5757
58-
<b><span>Příliš </span> <a href="http://green.example.com">žluťoučký</a><br>
59-
<a
60-
href='http://horse.example.com'
61-
style="abc"
62-
>
63-
žlutý
64-
kůň
65-
</a>
66-
</b>
67-
----------%S%--
68-
EOD
58+
<b><span>Příliš </span> <a href="http://green.example.com">žluťoučký</a><br>
59+
<a
60+
href='http://horse.example.com'
61+
style="abc"
62+
>
63+
žlutý
64+
kůň
65+
</a>
66+
</b>
67+
----------%S%--
68+
EOD
6969
, TestMailer::$output);

tests/Mail/Mail.HtmlBodyAndLinks.phpt

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,27 @@ $mailer = new TestMailer;
2828
$mailer->send($mail);
2929

3030
Assert::match(<<<'EOD'
31-
MIME-Version: 1.0
32-
X-Mailer: Nette Framework
33-
Date: %a%
34-
From: John Doe <[email protected]>
35-
To: Lady Jane <[email protected]>
36-
Subject: Hello Jane!
37-
Message-ID: <%S%@%S%>
38-
Content-Type: multipart/alternative;
39-
boundary="--------%S%"
40-
41-
----------%S%
42-
Content-Type: text/plain; charset=UTF-8
43-
Content-Transfer-Encoding: 8bit
44-
45-
Příliš žluťoučký <http://green.example.com> "
46-
kůň <http://horse.example.com>
47-
----------%S%
48-
Content-Type: text/html; charset=UTF-8
49-
Content-Transfer-Encoding: 8bit
50-
51-
<b><span>Příliš </span> <a href="http://green.example.com">žluťoučký</a> " <br><a href='http://horse.example.com'>kůň</a></b>
52-
----------%S%--
53-
EOD
31+
MIME-Version: 1.0
32+
X-Mailer: Nette Framework
33+
Date: %a%
34+
From: John Doe <[email protected]>
35+
To: Lady Jane <[email protected]>
36+
Subject: Hello Jane!
37+
Message-ID: <%S%@%S%>
38+
Content-Type: multipart/alternative;
39+
boundary="--------%S%"
40+
41+
----------%S%
42+
Content-Type: text/plain; charset=UTF-8
43+
Content-Transfer-Encoding: 8bit
44+
45+
Příliš žluťoučký <http://green.example.com> "
46+
kůň <http://horse.example.com>
47+
----------%S%
48+
Content-Type: text/html; charset=UTF-8
49+
Content-Transfer-Encoding: 8bit
50+
51+
<b><span>Příliš </span> <a href="http://green.example.com">žluťoučký</a> " <br><a href='http://horse.example.com'>kůň</a></b>
52+
----------%S%--
53+
EOD
5454
, TestMailer::$output);

tests/Mail/Mail.attachment.eml.phpt

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,24 @@ $mail->addAttachment(__DIR__ . '/fixtures/example.eml', null, 'MESSAGE/RFC822');
2222
$mailer->send($mail);
2323

2424
Assert::match(<<<'EOD'
25-
MIME-Version: 1.0
26-
X-Mailer: Nette Framework
27-
Date: %a%
28-
Message-ID: <%S%@%S%>
29-
Content-Type: multipart/mixed;
30-
boundary="--------%S%"
31-
32-
----------%S%
33-
Content-Type: text/plain; charset=UTF-8
34-
Content-Transfer-Encoding: 7bit
35-
36-
37-
----------%S%
38-
Content-Type: application/octet-stream
39-
Content-Transfer-Encoding: base64
40-
Content-Disposition: attachment; filename="example.eml"
41-
42-
Um%A%=
43-
----------%S%--
44-
EOD
25+
MIME-Version: 1.0
26+
X-Mailer: Nette Framework
27+
Date: %a%
28+
Message-ID: <%S%@%S%>
29+
Content-Type: multipart/mixed;
30+
boundary="--------%S%"
31+
32+
----------%S%
33+
Content-Type: text/plain; charset=UTF-8
34+
Content-Transfer-Encoding: 7bit
35+
36+
37+
----------%S%
38+
Content-Type: application/octet-stream
39+
Content-Transfer-Encoding: base64
40+
Content-Disposition: attachment; filename="example.eml"
41+
42+
Um%A%=
43+
----------%S%--
44+
EOD
4545
, TestMailer::$output);

0 commit comments

Comments
 (0)