Skip to content

Commit 8adfe8a

Browse files
committed
code cleanup
1 parent fb7ccf7 commit 8adfe8a

File tree

8 files changed

+10
-24
lines changed

8 files changed

+10
-24
lines changed

src/Email.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
namespace Buildcode\LaravelDatabaseEmails;
44

55
use Illuminate\Database\Eloquent\Model;
6-
use Illuminate\Mail\Message;
7-
use Illuminate\Support\Facades\Event;
8-
use Illuminate\Support\Facades\Mail;
96
use Carbon\Carbon;
107
use Exception;
118

@@ -31,9 +28,6 @@
3128
*/
3229
class Email extends Model
3330
{
34-
/**
35-
* Make sure all encrypted attributes are decrypted.
36-
*/
3731
use HasEncryptedAttributes;
3832

3933
/**
@@ -97,9 +91,9 @@ public function getRecipient()
9791
*/
9892
public function getRecipientsAsString()
9993
{
100-
$glue = ',';
94+
$glue = ', ';
10195

102-
return implode($glue, (array) $this->recipient);
96+
return implode($glue, (array)$this->recipient);
10397
}
10498

10599
/**
@@ -183,7 +177,6 @@ public function getAttempts()
183177
return $this->attempts;
184178
}
185179

186-
187180
/**
188181
* Get the scheduled date.
189182
*
@@ -268,7 +261,6 @@ public function isScheduled()
268261
return !is_null($this->getScheduledDate());
269262
}
270263

271-
272264
/**
273265
* Determine if the e-mail is encrypted.
274266
*
@@ -340,7 +332,7 @@ public function markAsFailed(Exception $exception)
340332
$this->update([
341333
'sending' => 0,
342334
'failed' => 1,
343-
'error' => (string) $exception,
335+
'error' => (string)$exception,
344336
]);
345337
}
346338

src/EmailComposer.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function getEmail()
4444
* Set a data value.
4545
*
4646
* @param string $key
47-
* @param mixed $value
47+
* @param mixed $value
4848
* @return static
4949
*/
5050
public function setData($key, $value)
@@ -58,7 +58,7 @@ public function setData($key, $value)
5858
* Get a data value.
5959
*
6060
* @param string $key
61-
* @param mixed $default
61+
* @param mixed $default
6262
* @return mixed
6363
*/
6464
public function getData($key, $default = null)
@@ -201,7 +201,7 @@ public function mailable(Mailable $mailable)
201201
* Attach a file to the e-mail.
202202
*
203203
* @param string $file
204-
* @param array $options
204+
* @param array $options
205205
* @return static
206206
*/
207207
public function attach($file, $options = [])
@@ -216,8 +216,8 @@ public function attach($file, $options = [])
216216
/**
217217
* Attach in-memory data as an attachment.
218218
*
219-
* @param string $data
220-
* @param string $name
219+
* @param string $data
220+
* @param string $name
221221
* @param array $options
222222
* @return $this
223223
*/

src/MailableReader.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use function call_user_func_array;
66
use Exception;
7-
use Illuminate\Mail\Mailable;
87

98
class MailableReader
109
{

src/Store.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function getQueue()
3434
* Get all e-mails that failed to be sent.
3535
*
3636
* @param int $id
37-
* @return Collection
37+
* @return Collection|Email[]
3838
*/
3939
public function getFailed($id = null)
4040
{

src/Validator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ private function validateView(EmailComposer $composer)
144144
$view = $composer->getData('view');
145145

146146
if (!view()->exists($view)) {
147-
throw new InvalidArgumentException('View [' . $view .'] does not exist');
147+
throw new InvalidArgumentException('View [' . $view . '] does not exist');
148148
}
149149
}
150150

tests/EncryptionTest.php

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

33
namespace Tests;
44

5-
use Buildcode\LaravelDatabaseEmails\Email;
6-
75
class EncryptionTest extends TestCase
86
{
97
function setUp()

tests/RetryFailedEmailsCommandTest.php

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

33
namespace Tests;
44

5-
use Buildcode\LaravelDatabaseEmails\Store;
65
use Illuminate\Support\Facades\DB;
7-
use Illuminate\Support\Facades\Event;
86

97
class RetryFailedEmailsCommandTest extends TestCase
108
{

tests/SendEmailsCommandTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use Buildcode\LaravelDatabaseEmails\Store;
66
use Carbon\Carbon;
77
use Illuminate\Support\Facades\DB;
8-
use Illuminate\Support\Facades\Event;
98

109
class SendEmailsCommandTest extends TestCase
1110
{

0 commit comments

Comments
 (0)