Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Nov 15, 2024
1 parent 258683b commit e260ce8
Show file tree
Hide file tree
Showing 39 changed files with 90 additions and 81 deletions.
5 changes: 1 addition & 4 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand All @@ -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)
{
//
}
}
11 changes: 10 additions & 1 deletion app/Enums/ResponseCode.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace App\Enums;

use Jiannei\Enum\Laravel\Support\Traits\EnumEnhance;
Expand All @@ -26,4 +35,4 @@ enum ResponseCode: int
case SYSTEM_CACHE_CONFIG_ERROR = 500003;
case SYSTEM_CACHE_MISSED_ERROR = 500004;
case SYSTEM_CONFIG_ERROR = 500005;
}
}
2 changes: 1 addition & 1 deletion app/Events/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand Down
3 changes: 1 addition & 2 deletions app/Events/ExampleEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand All @@ -20,6 +20,5 @@ class ExampleEvent extends Event
*/
public function __construct()
{
//
}
}
7 changes: 3 additions & 4 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand Down Expand Up @@ -76,7 +76,7 @@ public function refresh()
/**
* Get the token array structure.
*
* @param string $token
* @param string $token
*
* @return \Illuminate\Http\JsonResponse
*/
Expand Down
3 changes: 1 addition & 2 deletions app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand All @@ -15,5 +15,4 @@

abstract class Controller extends BaseController
{
//
}
3 changes: 1 addition & 2 deletions app/Http/Controllers/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand All @@ -18,7 +18,6 @@

class UsersController extends Controller
{

public function __construct(private UserService $service)
{
$this->middleware('auth:api', ['except' => ['store', 'show']]);
Expand Down
9 changes: 4 additions & 5 deletions app/Http/Middleware/Authenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand All @@ -27,7 +27,6 @@ class Authenticate
/**
* Create a new middleware instance.
*
* @param \Illuminate\Contracts\Auth\Factory $auth
* @return void
*/
public function __construct(Auth $auth)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Resources/UserResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand Down
4 changes: 1 addition & 3 deletions app/Jobs/ExampleJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand All @@ -20,7 +20,6 @@ class ExampleJob extends Job
*/
public function __construct()
{
//
}

/**
Expand All @@ -30,6 +29,5 @@ public function __construct()
*/
public function handle()
{
//
}
}
6 changes: 4 additions & 2 deletions app/Jobs/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand All @@ -29,5 +29,7 @@ abstract class Job implements ShouldQueue
|
*/

use InteractsWithQueue, Queueable, SerializesModels;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
}
5 changes: 1 addition & 4 deletions app/Listeners/ExampleListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand All @@ -22,17 +22,14 @@ class ExampleListener
*/
public function __construct()
{
//
}

/**
* Handle the event.
*
* @param \App\Events\ExampleEvent $event
* @return void
*/
public function handle(ExampleEvent $event)
{
//
}
}
8 changes: 5 additions & 3 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand All @@ -19,9 +19,11 @@
use Laravel\Lumen\Auth\Authorizable;
use Tymon\JWTAuth\Contracts\JWTSubject;

class User extends Model implements AuthenticatableContract, AuthorizableContract,JWTSubject
class User extends Model implements AuthenticatableContract, AuthorizableContract, JWTSubject
{
use Authenticatable, Authorizable, HasFactory;
use Authenticatable;
use Authorizable;
use HasFactory;

/**
* The attributes that are mass assignable.
Expand Down
3 changes: 1 addition & 2 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand All @@ -22,6 +22,5 @@ class AppServiceProvider extends ServiceProvider
*/
public function register()
{
//
}
}
3 changes: 1 addition & 2 deletions app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand All @@ -23,7 +23,6 @@ class AuthServiceProvider extends ServiceProvider
*/
public function register()
{
//
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Providers/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand Down
2 changes: 1 addition & 1 deletion app/Services/UserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand Down
2 changes: 1 addition & 1 deletion app/Support/Traits/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand Down
3 changes: 1 addition & 2 deletions app/Support/Traits/SerializeDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand All @@ -19,7 +19,6 @@ trait SerializeDate
/**
* 为数组 / JSON 序列化准备日期。(Laravel 7).
*
* @param \DateTimeInterface $date
* @return string
*/
protected function serializeDate(DateTimeInterface $date)
Expand Down
2 changes: 1 addition & 1 deletion app/Support/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand Down
8 changes: 4 additions & 4 deletions bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
* (c) Jiannei <jiannei@sinan.fun>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand Down Expand Up @@ -87,9 +87,9 @@
// App\Http\Middleware\ExampleMiddleware::class
// ]);

$app->routeMiddleware([
'auth' => App\Http\Middleware\Authenticate::class,
]);
$app->routeMiddleware([
'auth' => App\Http\Middleware\Authenticate::class,
]);

/*
|--------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit e260ce8

Please sign in to comment.