Skip to content

Commit bf43602

Browse files
authored
wip (#34329)
1 parent 4068b48 commit bf43602

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Illuminate/View/ComponentAttributeBag.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ public function whereStartsWith($string)
126126
*/
127127
public function whereDoesntStartWith($string)
128128
{
129-
return $this->reject(function ($value, $key) use ($string) {
130-
return Str::startsWith($key, $string);
129+
return $this->filter(function ($value, $key) use ($string) {
130+
return ! Str::startsWith($key, $string);
131131
});
132132
}
133133

tests/View/ViewComponentAttributeBagTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ public function testAttributeRetrieval()
1313

1414
$this->assertSame('class="font-bold"', (string) $bag->whereStartsWith('class'));
1515
$this->assertSame('font-bold', (string) $bag->whereStartsWith('class')->first());
16+
$this->assertSame('name="test"', (string) $bag->whereDoesntStartWith('class'));
17+
$this->assertSame('test', (string) $bag->whereDoesntStartWith('class')->first());
1618
$this->assertSame('class="mt-4 font-bold" name="test"', (string) $bag->merge(['class' => 'mt-4']));
1719
$this->assertSame('class="mt-4 font-bold" name="test"', (string) $bag->merge(['class' => 'mt-4', 'name' => 'foo']));
1820
$this->assertSame('class="mt-4 font-bold" id="bar" name="test"', (string) $bag->merge(['class' => 'mt-4', 'id' => 'bar']));

0 commit comments

Comments
 (0)