Skip to content

Commit ca12a45

Browse files
committed
Bit of formatting
1 parent 04e330b commit ca12a45

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Mailtrap.php

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

33
namespace Codeception\Module;
44

5-
use Codeception\Module;
65
use GuzzleHttp\Client;
76
use GuzzleHttp\Psr7\Stream;
87

@@ -61,7 +60,7 @@ public function _initialize()
6160
{
6261
$this->client = new Client([
6362
'base_uri' => $this->baseUrl,
64-
'headers' => [
63+
'headers' => [
6564
'Api-Token' => $this->config['client_id'],
6665
],
6766
]);
@@ -113,10 +112,11 @@ public function receiveAnEmail($params)
113112
public function fetchLastMessage()
114113
{
115114
$messages = $this->client->get("inboxes/{$this->config['inbox_id']}/messages")->getBody();
115+
116116
if ($messages instanceof Stream) {
117117
$messages = $messages->getContents();
118118
}
119-
119+
120120
$messages = json_decode($messages, true);
121121

122122
return array_shift($messages);
@@ -260,7 +260,6 @@ public function seeInEmailHtmlBody($expected)
260260
public function seeAttachments($count)
261261
{
262262
$attachments = $this->fetchAttachmentsOfLastMessage();
263-
264263
$this->assertEquals($count, count($attachments));
265264
}
266265

@@ -272,7 +271,6 @@ public function seeAttachments($count)
272271
public function seeAnAttachment($bool)
273272
{
274273
$attachments = $this->fetchAttachmentsOfLastMessage();
275-
276274
$this->assertEquals($bool, count($attachments) > 0);
277275
}
278276

@@ -286,6 +284,7 @@ public function seeAnAttachment($bool)
286284
public function fetchLastMessages($number = 1)
287285
{
288286
$messages = $this->client->get("inboxes/{$this->config['inbox_id']}/messages")->getBody();
287+
289288
if ($messages instanceof Stream) {
290289
$messages = $messages->getContents();
291290
}
@@ -311,13 +310,14 @@ public function fetchLastMessages($number = 1)
311310
public function getBccEmailOfMessage($messageId)
312311
{
313312
$message = $this->client->get("inboxes/{$this->config['inbox_id']}/messages/$messageId/body.eml")->getBody();
313+
314314
if ($message instanceof Stream) {
315315
$message = $message->getContents();
316316
}
317317
$matches = [];
318318
preg_match('/Bcc:\s[\w.-]+@[\w.-]+\.[a-z]{2,6}/', $message, $matches);
319319

320-
$bcc = substr(array_shift($matches),5);
320+
$bcc = substr(array_shift($matches), 5);
321321

322322
return $bcc;
323323
}

0 commit comments

Comments
 (0)