Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot authored and jiannei committed Oct 14, 2023
1 parent 3b92825 commit 3778be0
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 17 deletions.
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 <longjian.huang@foxmail.com>
*
* 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;
}
}
3 changes: 1 addition & 2 deletions app/Http/Controllers/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function login()
{
$credentials = request(['email', 'password']);

if (!$token = auth()->attempt($credentials)) {
if (! $token = auth()->attempt($credentials)) {
return Response::errorUnauthorized();
}

Expand Down Expand Up @@ -77,7 +77,6 @@ public function refresh()
* Get the token array structure.
*
* @param string $token
*
* @return \Illuminate\Http\JsonResponse
*/
protected function respondWithToken($token)
Expand Down
1 change: 0 additions & 1 deletion app/Http/Controllers/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

class UsersController extends Controller
{

public function __construct(private UserService $service)
{
$this->middleware('auth:api', ['except' => ['store', 'show']]);
Expand Down
2 changes: 1 addition & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
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;

Expand Down
6 changes: 3 additions & 3 deletions bootstrap/app.php
Original file line number Diff line number Diff line change
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
9 changes: 9 additions & 0 deletions config/app.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 <longjian.huang@foxmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

return [

/*
Expand Down
13 changes: 11 additions & 2 deletions config/auth.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 <longjian.huang@foxmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

return [

/*
Expand Down Expand Up @@ -61,8 +70,8 @@
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => \App\Models\User::class
]
'model' => \App\Models\User::class,
],
],

/*
Expand Down
2 changes: 1 addition & 1 deletion config/response.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the jiannei/laravel-response.
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
*
Expand Down
6 changes: 3 additions & 3 deletions database/seeders/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class DatabaseSeeder extends Seeder
*/
public function run()
{
$this->call([
UsersSeeder::class
]);
$this->call([
UsersSeeder::class,
]);
}
}
2 changes: 1 addition & 1 deletion resources/lang/zh_CN/enums.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the jiannei/laravel-response.
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
*
Expand Down
3 changes: 1 addition & 2 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
*/

/** @var \Laravel\Lumen\Routing\Router $router */

$router->get('/', function () use ($router) {
return $router->app->version();
});
Expand All @@ -33,4 +32,4 @@
$router->delete('logout', 'AuthController@logout');
$router->put('refresh', 'AuthController@refresh');
$router->get('me', 'AuthController@me');
});
});

0 comments on commit 3778be0

Please sign in to comment.