@@ -18,12 +18,6 @@ class PendingBroadcast
1818 /** @var Channel[] */
1919 public array $ channels ;
2020
21- public string $ action ;
22-
23- public ?string $ target = null ;
24-
25- public ?string $ targets = null ;
26-
2721 public ?string $ partialView = null ;
2822
2923 public ?array $ partialData = [];
@@ -32,8 +26,6 @@ class PendingBroadcast
3226
3327 public bool $ escapeInlineContent = true ;
3428
35- public array $ attributes = [];
36-
3729 /**
3830 * Whether we should broadcast only to other users and
3931 * ignore the current user's broadcasting socket.
@@ -61,7 +53,7 @@ class PendingBroadcast
6153 *
6254 * @var ?\HotwiredLaravel\TurboLaravel\Broadcasting\Factory = null
6355 */
64- protected $ recorder = null ;
56+ protected $ recorder ;
6557
6658 /**
6759 * These cancel callbacks will run right before the broadcasting is fired on __destruct.
@@ -70,13 +62,8 @@ class PendingBroadcast
7062 */
7163 protected array $ deferredCancelCallbacks = [];
7264
73- public function __construct (array $ channels , string $ action , Rendering $ rendering , ?string $ target = null , ?string $ targets = null , array $ attributes = [])
65+ public function __construct (array $ channels , public string $ action , Rendering $ rendering , public ?string $ target = null , public ?string $ targets = null , public array $ attributes = [])
7466 {
75- $ this ->action = $ action ;
76- $ this ->target = $ target ;
77- $ this ->targets = $ targets ;
78- $ this ->attributes = $ attributes ;
79-
8067 $ this ->to ($ channels );
8168 $ this ->rendering ($ rendering );
8269 }
@@ -142,12 +129,12 @@ public function view(?string $view, array $data = []): self
142129 return $ this ->rendering (new Rendering ($ view , $ data ));
143130 }
144131
145- public function content ($ content )
132+ public function content (\ Illuminate \ Contracts \ View \ View | \ Illuminate \ Support \ HtmlString | string $ content )
146133 {
147134 return $ this ->rendering (Rendering::forContent ($ content ));
148135 }
149136
150- public function attributes (array $ attributes )
137+ public function attributes (array $ attributes ): static
151138 {
152139 $ this ->attributes = $ attributes ;
153140
@@ -170,7 +157,7 @@ public function method(?string $method = null): self
170157 return $ this ->attributes (Arr::except ($ this ->attributes , 'method ' ));
171158 }
172159
173- public function rendering (Rendering $ rendering )
160+ public function rendering (Rendering $ rendering ): static
174161 {
175162 $ this ->partialView = $ rendering ->partial ;
176163 $ this ->partialData = $ rendering ->data ;
@@ -187,28 +174,28 @@ public function later(bool $later = true): self
187174 return $ this ;
188175 }
189176
190- public function cancel ()
177+ public function cancel (): static
191178 {
192179 $ this ->wasCancelled = true ;
193180
194181 return $ this ;
195182 }
196183
197- public function cancelIf ($ condition )
184+ public function cancelIf ($ condition ): static
198185 {
199186 $ this ->wasCancelled = $ this ->wasCancelled || boolval (value ($ condition , $ this ));
200187
201188 return $ this ;
202189 }
203190
204- public function lazyCancelIf (callable $ condition )
191+ public function lazyCancelIf (callable $ condition ): static
205192 {
206193 $ this ->deferredCancelCallbacks [] = $ condition ;
207194
208195 return $ this ;
209196 }
210197
211- public function fake ($ recorder = null )
198+ public function fake ($ recorder = null ): static
212199 {
213200 $ this ->isRecording = true ;
214201 $ this ->recorder = $ recorder ;
0 commit comments