Skip to content

Commit a471bfe

Browse files
[12.x] Rename NamedScope to Scope (#57478)
* Update EloquentNamedScopeAttributeTest.php * Update NamedScopeUser.php * Update EloquentModelScopeTest.php
1 parent 6639cc1 commit a471bfe

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

tests/Integration/Database/EloquentModelScopeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Illuminate\Tests\Integration\Database;
44

55
use Illuminate\Contracts\Database\Eloquent\Builder;
6-
use Illuminate\Database\Eloquent\Attributes\Scope as NamedScope;
6+
use Illuminate\Database\Eloquent\Attributes\Scope;
77
use Illuminate\Database\Eloquent\Model;
88

99
class EloquentModelScopeTest extends DatabaseTestCase
@@ -37,7 +37,7 @@ public function scopeExists(Builder $builder)
3737
return $builder;
3838
}
3939

40-
#[NamedScope]
40+
#[Scope]
4141
protected function existsAsWell(Builder $builder)
4242
{
4343
return $builder;

tests/Integration/Database/EloquentNamedScopeAttributeTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ protected function setUp(): void
2121
);
2222
}
2323

24-
#[DataProvider('namedScopeDataProvider')]
24+
#[DataProvider('scopeDataProvider')]
2525
public function test_it_can_query_named_scoped_from_the_query_builder(string $methodName)
2626
{
2727
$query = Fixtures\NamedScopeUser::query()->{$methodName}(true);
2828

2929
$this->assertSame($this->query, $query->toRawSql());
3030
}
3131

32-
#[DataProvider('namedScopeDataProvider')]
32+
#[DataProvider('scopeDataProvider')]
3333
public function test_it_can_query_named_scoped_from_static_query(string $methodName)
3434
{
3535
$query = Fixtures\NamedScopeUser::{$methodName}(true);
3636

3737
$this->assertSame($this->query, $query->toRawSql());
3838
}
3939

40-
public static function namedScopeDataProvider(): array
40+
public static function scopeDataProvider(): array
4141
{
4242
return [
4343
'scope with return' => ['verified'],

tests/Integration/Database/Fixtures/NamedScopeUser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Illuminate\Tests\Integration\Database\Fixtures;
44

5-
use Illuminate\Database\Eloquent\Attributes\Scope as NamedScope;
5+
use Illuminate\Database\Eloquent\Attributes\Scope;
66
use Illuminate\Database\Eloquent\Builder;
77

88
class NamedScopeUser extends User
@@ -17,7 +17,7 @@ protected function casts(): array
1717
];
1818
}
1919

20-
#[NamedScope]
20+
#[Scope]
2121
protected function verified(Builder $builder, bool $email = true)
2222
{
2323
return $builder->when(
@@ -27,7 +27,7 @@ protected function verified(Builder $builder, bool $email = true)
2727
);
2828
}
2929

30-
#[NamedScope]
30+
#[Scope]
3131
protected function verifiedWithoutReturn(Builder $builder, bool $email = true)
3232
{
3333
$this->verified($builder, $email);

0 commit comments

Comments
 (0)