File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -314,6 +314,7 @@ public function prepend(Closure|array|null $prepend = null): static
314314 if (is_array ($ this ->prepend ) && isset ($ this ->prepend ['name ' ], $ this ->prepend ['value ' ])) {
315315 $ this ->prepend ['value ' ] = (string ) $ this ->prepend ['value ' ];
316316 } else if (is_null ($ this ->prepend )){
317+ # Avoid throwing an exception in case $prepend is explicitly set to null, or a Closure evaluates to null.
317318 } else {
318319 throw new InvalidArgumentException ('The provided prepend value must be an array with "name" and "value" keys. ' );
319320 }
@@ -328,6 +329,7 @@ public function append(Closure|array|null $append = null): static
328329 if (is_array ($ this ->append ) && isset ($ this ->append ['name ' ], $ this ->append ['value ' ])) {
329330 $ this ->append ['value ' ] = (string ) $ this ->append ['value ' ];
330331 } else if (is_null ($ this ->append )) {
332+ # Avoid throwing an exception in case $append is explicitly set to null, or a Closure evaluates to null.
331333 } else {
332334 throw new \InvalidArgumentException ('The provided append value must be an array with "name" and "value" keys. ' );
333335 }
You can’t perform that action at this time.
0 commit comments