From 867ca63f952fcfaf6173b30b1927ac35576a68b5 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Thu, 11 Jan 2024 06:22:57 +0000 Subject: [PATCH] Apply fixes from StyleCI --- app/Console/Kernel.php | 5 +---- app/Enums/ResponseCode.php | 2 +- app/Events/Event.php | 2 +- app/Events/ExampleEvent.php | 3 +-- app/Exceptions/Handler.php | 7 +++---- app/Http/Controllers/AuthController.php | 7 ++++--- app/Http/Controllers/Controller.php | 3 +-- app/Http/Controllers/UsersController.php | 2 +- app/Http/Middleware/Authenticate.php | 9 ++++----- app/Http/Resources/UserResource.php | 2 +- app/Jobs/ExampleJob.php | 4 +--- app/Jobs/Job.php | 6 ++++-- app/Listeners/ExampleListener.php | 5 +---- app/Models/User.php | 6 ++++-- app/Providers/AppServiceProvider.php | 3 +-- app/Providers/AuthServiceProvider.php | 3 +-- app/Providers/EventServiceProvider.php | 2 +- app/Services/UserService.php | 2 +- app/Support/Traits/Helpers.php | 2 +- app/Support/Traits/SerializeDate.php | 3 +-- app/Support/helpers.php | 2 +- bootstrap/app.php | 2 +- config/app.php | 4 +--- config/auth.php | 5 +---- config/response.php | 3 +-- database/factories/PostFactory.php | 2 +- database/factories/UserFactory.php | 2 +- .../migrations/2020_05_30_115810_create_users_table.php | 2 +- .../migrations/2020_10_16_105234_create_posts_table.php | 2 +- database/seeders/DatabaseSeeder.php | 2 +- database/seeders/UsersSeeder.php | 2 +- public/index.php | 2 +- resources/lang/zh_CN/enums.php | 2 +- routes/web.php | 4 ++-- tests/ExampleTest.php | 2 +- tests/Feature/ExampleTest.php | 4 ++-- tests/TestCase.php | 2 +- tests/Traits/CreatesApplication.php | 2 +- tests/Unit/ExampleTest.php | 2 +- 39 files changed, 55 insertions(+), 71 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index d9721ce..4931aca 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. @@ -22,17 +22,14 @@ class Kernel extends ConsoleKernel * @var array */ protected $commands = [ - // ]; /** * Define the application's command schedule. * - * @param \Illuminate\Console\Scheduling\Schedule $schedule * @return void */ protected function schedule(Schedule $schedule) { - // } } diff --git a/app/Enums/ResponseCode.php b/app/Enums/ResponseCode.php index 5ac1d89..502a52d 100644 --- a/app/Enums/ResponseCode.php +++ b/app/Enums/ResponseCode.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. diff --git a/app/Events/Event.php b/app/Events/Event.php index e91cf20..464f7d2 100644 --- a/app/Events/Event.php +++ b/app/Events/Event.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. diff --git a/app/Events/ExampleEvent.php b/app/Events/ExampleEvent.php index 4d993ab..9804543 100644 --- a/app/Events/ExampleEvent.php +++ b/app/Events/ExampleEvent.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. @@ -20,6 +20,5 @@ class ExampleEvent extends Event */ public function __construct() { - // } } diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index e048185..e402b79 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. @@ -40,7 +40,6 @@ class Handler extends ExceptionHandler * * This is a great spot to send exceptions to Sentry, Bugsnag, etc. * - * @param \Throwable $exception * @return void * * @throws \Exception @@ -53,8 +52,8 @@ public function report(Throwable $exception) /** * Render an exception into an HTTP response. * - * @param \Illuminate\Http\Request $request - * @param \Throwable $exception + * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse * * @throws \Throwable diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index d28468c..fc7117d 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. @@ -34,7 +34,7 @@ public function login() { $credentials = request(['email', 'password']); - if (! $token = auth()->attempt($credentials)) { + if (!$token = auth()->attempt($credentials)) { return Response::errorUnauthorized(); } @@ -76,7 +76,8 @@ public function refresh() /** * Get the token array structure. * - * @param string $token + * @param string $token + * * @return \Illuminate\Http\JsonResponse */ protected function respondWithToken($token) diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index c6bb269..84a0973 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. @@ -15,5 +15,4 @@ abstract class Controller extends BaseController { - // } diff --git a/app/Http/Controllers/UsersController.php b/app/Http/Controllers/UsersController.php index bf747ee..1bc1d0d 100644 --- a/app/Http/Controllers/UsersController.php +++ b/app/Http/Controllers/UsersController.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index ced04c4..8eb5645 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. @@ -27,7 +27,6 @@ class Authenticate /** * Create a new middleware instance. * - * @param \Illuminate\Contracts\Auth\Factory $auth * @return void */ public function __construct(Auth $auth) @@ -38,9 +37,9 @@ public function __construct(Auth $auth) /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param string|null $guard + * @param \Illuminate\Http\Request $request + * @param string|null $guard + * * @return mixed */ public function handle($request, Closure $next, $guard = null) diff --git a/app/Http/Resources/UserResource.php b/app/Http/Resources/UserResource.php index d627419..183852b 100644 --- a/app/Http/Resources/UserResource.php +++ b/app/Http/Resources/UserResource.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. diff --git a/app/Jobs/ExampleJob.php b/app/Jobs/ExampleJob.php index 846a3a9..af2a1fc 100644 --- a/app/Jobs/ExampleJob.php +++ b/app/Jobs/ExampleJob.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. @@ -20,7 +20,6 @@ class ExampleJob extends Job */ public function __construct() { - // } /** @@ -30,6 +29,5 @@ public function __construct() */ public function handle() { - // } } diff --git a/app/Jobs/Job.php b/app/Jobs/Job.php index f86aa83..4cc68ef 100644 --- a/app/Jobs/Job.php +++ b/app/Jobs/Job.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. @@ -29,5 +29,7 @@ abstract class Job implements ShouldQueue | */ - use InteractsWithQueue, Queueable, SerializesModels; + use InteractsWithQueue; + use Queueable; + use SerializesModels; } diff --git a/app/Listeners/ExampleListener.php b/app/Listeners/ExampleListener.php index 48c1dfe..c64fd0b 100644 --- a/app/Listeners/ExampleListener.php +++ b/app/Listeners/ExampleListener.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. @@ -22,17 +22,14 @@ class ExampleListener */ public function __construct() { - // } /** * Handle the event. * - * @param \App\Events\ExampleEvent $event * @return void */ public function handle(ExampleEvent $event) { - // } } diff --git a/app/Models/User.php b/app/Models/User.php index c918701..c91074d 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. @@ -21,7 +21,9 @@ class User extends Model implements AuthenticatableContract, AuthorizableContract, JWTSubject { - use Authenticatable, Authorizable, HasFactory; + use Authenticatable; + use Authorizable; + use HasFactory; /** * The attributes that are mass assignable. diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index a40a503..d81014e 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. @@ -22,6 +22,5 @@ class AppServiceProvider extends ServiceProvider */ public function register() { - // } } diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 35cbb79..496d793 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. @@ -23,7 +23,6 @@ class AuthServiceProvider extends ServiceProvider */ public function register() { - // } /** diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index c87440a..6a2b005 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. diff --git a/app/Services/UserService.php b/app/Services/UserService.php index 2d9dc20..a287c9a 100644 --- a/app/Services/UserService.php +++ b/app/Services/UserService.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. diff --git a/app/Support/Traits/Helpers.php b/app/Support/Traits/Helpers.php index 59822b6..000882f 100644 --- a/app/Support/Traits/Helpers.php +++ b/app/Support/Traits/Helpers.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. diff --git a/app/Support/Traits/SerializeDate.php b/app/Support/Traits/SerializeDate.php index 9dbb4be..becbf93 100644 --- a/app/Support/Traits/SerializeDate.php +++ b/app/Support/Traits/SerializeDate.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. @@ -19,7 +19,6 @@ trait SerializeDate /** * 为数组 / JSON 序列化准备日期。(Laravel 7). * - * @param \DateTimeInterface $date * @return string */ protected function serializeDate(DateTimeInterface $date) diff --git a/app/Support/helpers.php b/app/Support/helpers.php index 8a140a0..dcac772 100644 --- a/app/Support/helpers.php +++ b/app/Support/helpers.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. diff --git a/bootstrap/app.php b/bootstrap/app.php index 91a4064..349b807 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. diff --git a/config/app.php b/config/app.php index 001d324..825bf5d 100644 --- a/config/app.php +++ b/config/app.php @@ -3,14 +3,13 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ return [ - /* |-------------------------------------------------------------------------- | Application Name @@ -116,5 +115,4 @@ 'key' => env('APP_KEY'), 'cipher' => 'AES-256-CBC', - ]; diff --git a/config/auth.php b/config/auth.php index 86f51d1..ce4981a 100644 --- a/config/auth.php +++ b/config/auth.php @@ -3,14 +3,13 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ return [ - /* |-------------------------------------------------------------------------- | Authentication Defaults @@ -94,7 +93,5 @@ */ 'passwords' => [ - // ], - ]; diff --git a/config/response.php b/config/response.php index 40641ad..cfef11b 100644 --- a/config/response.php +++ b/config/response.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. @@ -33,7 +33,6 @@ 'code' => 422, ], \Illuminate\Auth\AuthenticationException::class => [ - ], \Symfony\Component\HttpKernel\Exception\NotFoundHttpException::class => [ 'message' => '', diff --git a/database/factories/PostFactory.php b/database/factories/PostFactory.php index 87dcb60..411292f 100644 --- a/database/factories/PostFactory.php +++ b/database/factories/PostFactory.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 02f5a1b..5e4a2e7 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. diff --git a/database/migrations/2020_05_30_115810_create_users_table.php b/database/migrations/2020_05_30_115810_create_users_table.php index 68e6906..486c29b 100644 --- a/database/migrations/2020_05_30_115810_create_users_table.php +++ b/database/migrations/2020_05_30_115810_create_users_table.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. diff --git a/database/migrations/2020_10_16_105234_create_posts_table.php b/database/migrations/2020_10_16_105234_create_posts_table.php index f4f456a..dc1c7e6 100644 --- a/database/migrations/2020_10_16_105234_create_posts_table.php +++ b/database/migrations/2020_10_16_105234_create_posts_table.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 41c2443..df1e546 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. diff --git a/database/seeders/UsersSeeder.php b/database/seeders/UsersSeeder.php index ec3f84a..00138a6 100644 --- a/database/seeders/UsersSeeder.php +++ b/database/seeders/UsersSeeder.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. diff --git a/public/index.php b/public/index.php index 7fd67cf..d694d6b 100644 --- a/public/index.php +++ b/public/index.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. diff --git a/resources/lang/zh_CN/enums.php b/resources/lang/zh_CN/enums.php index 7818cb1..cf7414a 100644 --- a/resources/lang/zh_CN/enums.php +++ b/resources/lang/zh_CN/enums.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. diff --git a/routes/web.php b/routes/web.php index 36dcecd..5ef0546 100644 --- a/routes/web.php +++ b/routes/web.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. @@ -20,7 +20,7 @@ | */ -/** @var \Laravel\Lumen\Routing\Router $router */ +/* @var \Laravel\Lumen\Routing\Router $router */ $router->get('/', function () use ($router) { return $router->app->version(); }); diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php index 9906e23..52e0341 100644 --- a/tests/ExampleTest.php +++ b/tests/ExampleTest.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php index 67b3238..193bbae 100644 --- a/tests/Feature/ExampleTest.php +++ b/tests/Feature/ExampleTest.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. @@ -16,7 +16,7 @@ class ExampleTest extends TestCase { - //use DatabaseMigrations; + // use DatabaseMigrations; /** * A basic test example. diff --git a/tests/TestCase.php b/tests/TestCase.php index 045d474..fd0cbb1 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. diff --git a/tests/Traits/CreatesApplication.php b/tests/Traits/CreatesApplication.php index c86c305..bfbd7ea 100644 --- a/tests/Traits/CreatesApplication.php +++ b/tests/Traits/CreatesApplication.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php index a2fc830..45269f7 100644 --- a/tests/Unit/ExampleTest.php +++ b/tests/Unit/ExampleTest.php @@ -3,7 +3,7 @@ /* * This file is part of the Jiannei/lumen-api-starter. * - * (c) Jiannei + * (c) Jiannei * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE.