Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ca54da6

Browse files
authored
Revert "Fix Collection::implode with \Stringable objects (laravel#54630)" (laravel#54691)
This reverts commit 9626c3d.
1 parent 1af7e22 commit ca54da6

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

src/Illuminate/Collections/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ public function implode($value, $glue = null)
628628

629629
$first = $this->first();
630630

631-
if (is_array($first) || (is_object($first) && ! $first instanceof \Stringable)) {
631+
if (is_array($first) || (is_object($first) && ! $first instanceof Stringable)) {
632632
return implode($glue ?? '', $this->pluck($value)->all());
633633
}
634634

tests/Support/SupportCollectionTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
use PHPUnit\Framework\TestCase;
2525
use ReflectionClass;
2626
use stdClass;
27-
use Symfony\Component\String\ByteString;
2827
use Symfony\Component\VarDumper\VarDumper;
2928
use Traversable;
3029
use UnexpectedValueException;
@@ -2332,13 +2331,6 @@ public function testImplode($collection)
23322331
$this->assertSame('taylor-foo,dayle-bar', $data->implode(fn ($user) => $user['name'].'-'.$user['email'], ','));
23332332
}
23342333

2335-
#[DataProvider('collectionClassProvider')]
2336-
public function testImplodeStringable($collection)
2337-
{
2338-
$data = new $collection([new ByteString('taylor'), new ByteString('dayle')]);
2339-
$this->assertSame('taylordayle', $data->implode(''));
2340-
}
2341-
23422334
#[DataProvider('collectionClassProvider')]
23432335
public function testTake($collection)
23442336
{

0 commit comments

Comments
 (0)