Skip to content

Commit 4b0c896

Browse files
committed
Leverage array_is_list(), get_debug_type(), is_countable(), is_iterable(), str_contains() and str_starts_with()
1 parent b5e9a6a commit 4b0c896

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

AbstractString.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ abstract public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF
558558
*/
559559
public function trimPrefix($prefix): static
560560
{
561-
if (\is_array($prefix) || $prefix instanceof \Traversable) {
561+
if (is_iterable($prefix)) {
562562
foreach ($prefix as $s) {
563563
$t = $this->trimPrefix($s);
564564

@@ -592,7 +592,7 @@ abstract public function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FE
592592
*/
593593
public function trimSuffix($suffix): static
594594
{
595-
if (\is_array($suffix) || $suffix instanceof \Traversable) {
595+
if (is_iterable($suffix)) {
596596
foreach ($suffix as $s) {
597597
$t = $this->trimSuffix($s);
598598

0 commit comments

Comments
 (0)