Skip to content

Commit 36f5aac

Browse files
authored
Fix returns with Mail & Notification components (#36559)
These methods were incorrectly returning values. Since nothing was returned in the first place and the proper DocBlocks were already in place, this should be a general safe thing to do.
1 parent 2d304d4 commit 36f5aac

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

src/Illuminate/Mail/Mailable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class Mailable implements MailableContract, Renderable
170170
*/
171171
public function send($mailer)
172172
{
173-
return $this->withLocale($this->locale, function () use ($mailer) {
173+
$this->withLocale($this->locale, function () use ($mailer) {
174174
Container::getInstance()->call([$this, 'build']);
175175

176176
$mailer = $mailer instanceof MailFactory

src/Illuminate/Mail/Mailer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public function bcc($users)
197197
*/
198198
public function html($html, $callback)
199199
{
200-
return $this->send(['html' => new HtmlString($html)], [], $callback);
200+
$this->send(['html' => new HtmlString($html)], [], $callback);
201201
}
202202

203203
/**
@@ -209,7 +209,7 @@ public function html($html, $callback)
209209
*/
210210
public function raw($text, $callback)
211211
{
212-
return $this->send(['raw' => $text], [], $callback);
212+
$this->send(['raw' => $text], [], $callback);
213213
}
214214

215215
/**
@@ -222,7 +222,7 @@ public function raw($text, $callback)
222222
*/
223223
public function plain($view, array $data, $callback)
224224
{
225-
return $this->send(['text' => $view], $data, $callback);
225+
$this->send(['text' => $view], $data, $callback);
226226
}
227227

228228
/**

src/Illuminate/Mail/PendingMail.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@ public function bcc($users)
114114
* Send a new mailable message instance.
115115
*
116116
* @param \Illuminate\Contracts\Mail\Mailable $mailable
117-
* @return mixed
117+
* @return void
118118
*/
119119
public function send(MailableContract $mailable)
120120
{
121-
return $this->mailer->send($this->fill($mailable));
121+
$this->mailer->send($this->fill($mailable));
122122
}
123123

124124
/**

src/Illuminate/Notifications/ChannelManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ChannelManager extends Manager implements DispatcherContract, FactoryContr
3434
*/
3535
public function send($notifiables, $notification)
3636
{
37-
return (new NotificationSender(
37+
(new NotificationSender(
3838
$this, $this->container->make(Bus::class), $this->container->make(Dispatcher::class), $this->locale)
3939
)->send($notifiables, $notification);
4040
}
@@ -49,7 +49,7 @@ public function send($notifiables, $notification)
4949
*/
5050
public function sendNow($notifiables, $notification, array $channels = null)
5151
{
52-
return (new NotificationSender(
52+
(new NotificationSender(
5353
$this, $this->container->make(Bus::class), $this->container->make(Dispatcher::class), $this->locale)
5454
)->sendNow($notifiables, $notification, $channels);
5555
}

src/Illuminate/Notifications/NotificationSender.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function send($notifiables, $notification)
7676
return $this->queueNotification($notifiables, $notification);
7777
}
7878

79-
return $this->sendNow($notifiables, $notification);
79+
$this->sendNow($notifiables, $notification);
8080
}
8181

8282
/**

src/Illuminate/Support/Testing/Fakes/EventFake.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ public function forgetPushed()
278278
*
279279
* @param string|object $event
280280
* @param mixed $payload
281-
* @return void
281+
* @return array|null
282282
*/
283283
public function until($event, $payload = [])
284284
{

src/Illuminate/Support/Testing/Fakes/NotificationFake.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ protected function notificationsFor($notifiable, $notification)
210210
*/
211211
public function send($notifiables, $notification)
212212
{
213-
return $this->sendNow($notifiables, $notification);
213+
$this->sendNow($notifiables, $notification);
214214
}
215215

216216
/**

src/Illuminate/Support/Testing/Fakes/PendingMailFake.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ public function __construct($mailer)
2222
* Send a new mailable message instance.
2323
*
2424
* @param \Illuminate\Contracts\Mail\Mailable $mailable
25-
* @return mixed
25+
* @return void
2626
*/
2727
public function send(Mailable $mailable)
2828
{
29-
return $this->mailer->send($this->fill($mailable));
29+
$this->mailer->send($this->fill($mailable));
3030
}
3131

3232
/**

src/Illuminate/Support/Testing/Fakes/QueueFake.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function assertPushedOn($queue, $job, $callback = null)
7474
[$job, $callback] = [$this->firstClosureParameterType($job), $job];
7575
}
7676

77-
return $this->assertPushed($job, function ($job, $pushedQueue) use ($callback, $queue) {
77+
$this->assertPushed($job, function ($job, $pushedQueue) use ($callback, $queue) {
7878
if ($pushedQueue !== $queue) {
7979
return false;
8080
}

0 commit comments

Comments
 (0)