Skip to content

Commit ad60218

Browse files
authored
Apply fixes from StyleCI (#193)
1 parent 095f868 commit ad60218

File tree

6 files changed

+4
-11
lines changed

6 files changed

+4
-11
lines changed

config/config.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
use Binaryk\LaravelRestify\Http\Middleware\AuthorizeRestify;
44
use Binaryk\LaravelRestify\Http\Middleware\DispatchRestifyStartingEvent;
5-
use Binaryk\LaravelRestify\Tests\Fixtures\Post\PostMiddleware;
65

76
return [
87
'auth' => [

src/Http/Controllers/ProfileAvatarController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public function __invoke(ProfileAvatarRequest $request)
2323
$user->{$request::$userAvatarAttribute} = $path;
2424
$user->save();
2525

26-
2726
$user->{ProfileAvatarRequest::$userAvatarAttribute} = url($user->{ProfileAvatarRequest::$userAvatarAttribute});
2827

2928
return $this->response()->model($user);

src/Http/Requests/InteractWithRepositories.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Binaryk\LaravelRestify\Restify;
99
use Illuminate\Database\Eloquent\Model;
1010
use Illuminate\Pipeline\Pipeline;
11-
use Throwable;
1211

1312
/**
1413
* @author Eduard Lupacescu <eduard.lupacescu@binarcode.com>
@@ -46,7 +45,7 @@ public function repository($key = null): ?Repository
4645
]), 404);
4746
}
4847

49-
if (!$repository::authorizedToUseRepository($this)) {
48+
if (! $repository::authorizedToUseRepository($this)) {
5049
throw new UnauthorizedException(__('Unauthorized to view repository :name. See "allowRestify" policy.', [
5150
'name' => $repository,
5251
]), 403);
@@ -121,7 +120,7 @@ public function newRepositoryWith($model, $uriKey = null)
121120
*/
122121
public function newQueryWithoutScopes($uriKey = null)
123122
{
124-
if (!$this->isViaRepository()) {
123+
if (! $this->isViaRepository()) {
125124
return $this->model($uriKey)->newQueryWithoutScopes();
126125
}
127126

@@ -188,7 +187,7 @@ public function viaParentModel()
188187
{
189188
$parent = $this->repository($this->viaRepository);
190189

191-
return once(fn() => $parent::newModel()->newQueryWithoutScopes()->whereKey($this->viaRepositoryId)->firstOrFail());
190+
return once(fn () => $parent::newModel()->newQueryWithoutScopes()->whereKey($this->viaRepositoryId)->firstOrFail());
192191
}
193192

194193
public function viaQuery()

tests/Controllers/RepositoryMiddlewaresTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Binaryk\LaravelRestify\Tests\Fixtures\Post\PostWithCustomMiddlewareRepository;
88
use Binaryk\LaravelRestify\Tests\IntegrationTest;
99
use Mockery as m;
10-
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
1110

1211
class RepositoryMiddlewaresTest extends IntegrationTest
1312
{
@@ -41,7 +40,7 @@ public function test_repository_can_have_custom_middleware()
4140
public function test_request_fails_if_middleware_abort()
4241
{
4342
PostWithCustomMiddlewareRepository::$middlewares = [
44-
PostAbortMiddleware::class
43+
PostAbortMiddleware::class,
4544
];
4645

4746
Restify::repositories([
@@ -54,7 +53,6 @@ public function test_request_fails_if_middleware_abort()
5453

5554
public function test_foreign_repository_middleware_should_not_be_invoked()
5655
{
57-
5856
$middleware = m::mock(PostAbortMiddleware::class);
5957

6058
$nextParam = null;

tests/Fixtures/Post/PostWithCustomMiddlewareRepository.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class PostWithCustomMiddlewareRepository extends Repository
1616

1717
public static $uriKey = 'post-with-middleware';
1818

19-
2019
public function fields(RestifyRequest $request)
2120
{
2221
return [

tests/IntegrationTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Binaryk\LaravelRestify\Tests\Fixtures\Post\PostMergeableRepository;
1212
use Binaryk\LaravelRestify\Tests\Fixtures\Post\PostRepository;
1313
use Binaryk\LaravelRestify\Tests\Fixtures\Post\PostUnauthorizedFieldRepository;
14-
use Binaryk\LaravelRestify\Tests\Fixtures\Post\PostWithCustomMiddlewareRepository;
1514
use Binaryk\LaravelRestify\Tests\Fixtures\Post\PostWithHiddenFieldRepository;
1615
use Binaryk\LaravelRestify\Tests\Fixtures\Post\PostWithUnauthorizedFieldsRepository;
1716
use Binaryk\LaravelRestify\Tests\Fixtures\User\User;

0 commit comments

Comments
 (0)