Skip to content

Commit f291b73

Browse files
committed
chore: typo fix
1 parent 93dba21 commit f291b73

File tree

20 files changed

+49
-50
lines changed

20 files changed

+49
-50
lines changed

contexts/Authorization/Application/Coordinators/RoleCoordinator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ public function updateRole(int $id, UpdateRoleDTO $data): Role
7878
return $role;
7979
}
8080

81-
public function subspendRole(int $id)
81+
public function suspendRole(int $id)
8282
{
8383
CompositePolicy::allOf([
8484
new GlobalPermissionPolicy('role.suspend'),
8585
])->check();
8686

8787
$role = $this->repository->getById(RoleId::fromInt($id));
88-
$role->subspend();
88+
$role->suspend();
8989

9090
$this->repository->update($role);
9191

contexts/Authorization/Application/Coordinators/UserIdentityCoordinator.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Contexts\Authorization\Application\DTOs\User\GetUserListDTO;
1010
use Contexts\Authorization\Application\DTOs\User\UpdateUserDTO;
1111
use Contexts\Authorization\Domain\Factories\UserIdentityFactory;
12+
use Contexts\Authorization\Domain\Policies\GlobalPermissionPolicy;
1213
use Contexts\Authorization\Domain\Repositories\UserRepository;
1314
use Contexts\Authorization\Domain\Role\Models\RoleId;
1415
use Contexts\Authorization\Domain\UserIdentity\Models\Email;
@@ -18,17 +19,15 @@
1819
use Contexts\Authorization\Domain\UserIdentity\Models\UserIdentity;
1920
use Contexts\Authorization\Domain\UserIdentity\Models\UserStatus;
2021
use Contexts\Shared\Application\BaseCoordinator;
21-
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
2222
use Contexts\Shared\Policies\CompositePolicy;
23-
use Contexts\Authorization\Domain\Policies\GlobalPermissionPolicy;
23+
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
2424

2525
class UserIdentityCoordinator extends BaseCoordinator
2626
{
2727
public function __construct(
2828
private UserRepository $repository,
2929
private UserIdentityFactory $factory
30-
) {
31-
}
30+
) {}
3231

3332
public function create(CreateUserDTO $data): UserIdentity
3433
{
@@ -86,14 +85,14 @@ public function updateUser(int $id, UpdateUserDTO $data): UserIdentity
8685
return $user;
8786
}
8887

89-
public function subspendUser(int $id)
88+
public function suspendUser(int $id)
9089
{
9190
CompositePolicy::allOf([
92-
new GlobalPermissionPolicy('user.subspend'),
91+
new GlobalPermissionPolicy('user.suspend'),
9392
])->check();
9493

9594
$user = $this->repository->getById(UserId::fromInt($id));
96-
$user->subspend();
95+
$user->suspend();
9796

9897
$this->repository->update($user);
9998

contexts/Authorization/Domain/Role/Models/Role.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public static function reconstitute(
6161
return $role;
6262
}
6363

64-
public function subspend()
64+
public function suspend()
6565
{
6666
$this->transitionStatus(RoleStatus::suspended());
6767
}

contexts/Authorization/Domain/UserIdentity/Models/UserIdentity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public static function createFromFactory(
136136
return $user;
137137
}
138138

139-
public function subspend()
139+
public function suspend()
140140
{
141141
$this->transitionStatus(UserStatus::suspended());
142142
}

contexts/Authorization/Infrastructure/Routes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
Route::post('', 'createUser')->name('createUser');
2222
Route::patch('{id}/password', 'changePassword')->name('changePassword');
2323
Route::put('{id}/roles', 'updateRoles')->name('updateRoles');
24-
Route::put('{id}/subspend', 'subspendUser')->name('subspendUser');
24+
Route::put('{id}/suspend', 'suspendUser')->name('suspendUser');
2525
Route::put('{id}', 'updateUser')->name('updateUser');
2626
Route::delete('{id}', 'deleteUser')->name('deleteUser');
2727
});
@@ -30,7 +30,7 @@
3030
Route::get('', 'getRoleList')->name('getRoleList');
3131
Route::post('', 'createRole')->name('createRole');
3232
Route::patch('{id}/password', 'changePassword')->name('changePassword');
33-
Route::put('{id}/subspend', 'subspendRole')->name('subspendRole');
33+
Route::put('{id}/suspend', 'suspendRole')->name('suspendRole');
3434
Route::put('{id}', 'updateRole')->name('updateRole');
3535
Route::delete('{id}', 'deleteRole')->name('deleteRole');
3636
});

contexts/Authorization/Presentation/Controllers/RoleController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ public function updateRole(UpdateRoleRequest $request)
5858
->send();
5959
}
6060

61-
public function subspendRole(RoleIdRequest $request)
61+
public function suspendRole(RoleIdRequest $request)
6262
{
6363
$id = (int) ($request->validated()['id']);
64-
$result = app(RoleCoordinator::class)->subspendRole($id);
64+
$result = app(RoleCoordinator::class)->suspendRole($id);
6565

6666
return $this->success(['id' => $result->getId()->getValue()])
6767
->message('Role suspended successfully')

contexts/Authorization/Presentation/Controllers/UserIdentityController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ public function updateUser(UpdateUserRequest $request)
6060
->send();
6161
}
6262

63-
public function subspendUser(UserIdRequest $request)
63+
public function suspendUser(UserIdRequest $request)
6464
{
6565
$id = (int) ($request->validated()['id']);
66-
$result = app(UserIdentityCoordinator::class)->subspendUser($id);
66+
$result = app(UserIdentityCoordinator::class)->suspendUser($id);
6767

6868
return $this->success(['id' => $result->getId()->getValue()])
6969
->message('User suspended successfully')

contexts/Authorization/Tests/Feature/Infrastructure/Persistence/RolePersistenceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,15 @@
161161
'PHP Tutorial',
162162
new CarbonImmutable
163163
);
164-
$role2->subspend();
164+
$role2->suspend();
165165
$rolePersistence->create($role2);
166166

167167
$role3 = $this->roleFactory->create(
168168
RoleId::null(),
169169
'Laravel Tips',
170170
new CarbonImmutable
171171
);
172-
$role3->subspend();
172+
$role3->suspend();
173173
$rolePersistence->create($role3);
174174

175175
// Test search by label criteria

contexts/Authorization/Tests/Feature/Infrastructure/Persistence/UserPersistenceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
$password,
168168
'PHP Tutorial'
169169
);
170-
$user2->subspend();
170+
$user2->suspend();
171171
$userPersistence->create($user2);
172172

173173
$user3Email = new Email('tips@laravel.com');
@@ -177,7 +177,7 @@
177177
$password,
178178
'Laravel Tips'
179179
);
180-
$user3->subspend();
180+
$user3->suspend();
181181
$userPersistence->create($user3);
182182

183183
// Test search by display_name criteria

contexts/Authorization/Tests/Feature/RoleTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
]);
142142
});
143143

144-
it('can subspend a role', function () {
144+
it('can suspend a role', function () {
145145
$response = $this->postJson('roles', [
146146
'label' => 'My Role',
147147
'status' => 'active',
@@ -151,7 +151,7 @@
151151

152152
$id = $response->json('data.id');
153153

154-
$response = $this->putJson("roles/{$id}/subspend");
154+
$response = $this->putJson("roles/{$id}/suspend");
155155

156156
$response->assertStatus(200);
157157
});

0 commit comments

Comments
 (0)