Skip to content

Commit 013fd4f

Browse files
authored
Account for preg_split() also returning false
1 parent 68c6dfa commit 013fd4f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Concerns/InteractsWithElements.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,12 @@ public function append($field, $value)
166166
*/
167167
public function appendSlowly($field, $value, $pause = 100)
168168
{
169-
foreach (preg_split('//u', $value, -1, PREG_SPLIT_NO_EMPTY) as $char) {
170-
$this->append($field, $char)->pause($pause);
169+
$characters = preg_split('//u', $value, -1, PREG_SPLIT_NO_EMPTY);
170+
171+
if (is_array($characters)) {
172+
foreach ($characters as $character) {
173+
$this->append($field, $character)->pause($pause);
174+
}
171175
}
172176

173177
return $this;

0 commit comments

Comments
 (0)