diff --git a/app/Http/Requests/StoreBookRequest.php b/app/Http/Requests/StoreBookRequest.php index 9406bc6..9474c56 100644 --- a/app/Http/Requests/StoreBookRequest.php +++ b/app/Http/Requests/StoreBookRequest.php @@ -81,8 +81,8 @@ public function rules(): array 'string', 'filled', Rule::unique('books') - ->where(function ($query) { - return $query->where('isbn', $this->isbn); + ->where(function (\Illuminate\Database\Query\Builder $query) { + $query->where('isbn', $this->isbn); }), ], 'publisher_id' => 'integer|nullable', diff --git a/app/Http/Requests/StorePublisherRequest.php b/app/Http/Requests/StorePublisherRequest.php index 86a65f2..2d27f7d 100644 --- a/app/Http/Requests/StorePublisherRequest.php +++ b/app/Http/Requests/StorePublisherRequest.php @@ -88,9 +88,10 @@ public function rules(): array 'min:3', 'max:255', Rule::unique('publishers') - ->where(function ($query) { - return $query->where('email', $this->email) - && $query->where('website', $this->website); + ->where(function (\Illuminate\Database\Query\Builder $query) { + $query + ->where('email', $this->email) + ->where('website', $this->website); }), ], 'email' => 'required|string|email|filled', diff --git a/app/Http/Requests/UpdateBookRequest.php b/app/Http/Requests/UpdateBookRequest.php index b9d9130..b7674e0 100644 --- a/app/Http/Requests/UpdateBookRequest.php +++ b/app/Http/Requests/UpdateBookRequest.php @@ -82,8 +82,8 @@ public function rules(): array 'filled', Rule::unique('books') ->ignore($this->books) - ->where(function ($query) { - return $query->where('isbn', $this->isbn); + ->where(function (\Illuminate\Database\Query\Builder $query) { + $query->where('isbn', $this->isbn); }), ], 'publisher_id' => 'integer|nullable', diff --git a/app/Http/Requests/UpdatePublisherRequest.php b/app/Http/Requests/UpdatePublisherRequest.php index f521a7f..813d860 100644 --- a/app/Http/Requests/UpdatePublisherRequest.php +++ b/app/Http/Requests/UpdatePublisherRequest.php @@ -88,9 +88,10 @@ public function rules(): array 'max:255', Rule::unique('publishers') ->ignore($this->publisher) - ->where(function ($query) { - return $query->where('email', $this->email) - && $query->where('website', $this->website); + ->where(function (\Illuminate\Database\Query\Builder $query) { + $query + ->where('email', $this->email) + ->where('website', $this->website); }), ], 'email' => 'sometimes|required|string|email|filled', diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 5988f44..1fdf18d 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -8,6 +8,7 @@ use App\Repositories\PublisherRepository; use App\Services\BookService; use App\Services\PublisherService; +use Illuminate\Contracts\Foundation\Application; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider @@ -18,7 +19,7 @@ class AppServiceProvider extends ServiceProvider public function register(): void { $this->app->bind(BookRepositoryInterface::class, BookRepository::class); - $this->app->bind(BookService::class, function ($app) { + $this->app->bind(BookService::class, function (Application $app) { return new BookService( $app->make(BookRepositoryInterface::class), $app->make(PublisherRepositoryInterface::class), @@ -26,7 +27,7 @@ public function register(): void }); $this->app->bind(PublisherRepositoryInterface::class, PublisherRepository::class); - $this->app->bind(PublisherService::class, function ($app) { + $this->app->bind(PublisherService::class, function (Application $app) { return new PublisherService($app->make(PublisherRepositoryInterface::class)); }); } diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 6fe41e8..28b0aae 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -5,8 +5,8 @@ parameters: paths: - app/ - # Level 9 is the highest level - level: 9 + # Level 9 is the highest numeric level + level: max # ignoreErrors: # - '#PHPDoc tag @var#'