Passed
Branch master (04ddb2)
by Songda
04:41
created
database/migrations/2018_01_13_000001_create_api_access_tokens_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('api_access_tokens', function (Blueprint $table) {
16
+        Schema::create('api_access_tokens', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->integer('user_id');
19 19
             $table->string('app_id', 190);
Please login to merge, or discard this patch.
database/migrations/2018_01_13_000002_create_api_apps_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('api_apps', function (Blueprint $table) {
16
+        Schema::create('api_apps', function(Blueprint $table) {
17 17
             $table->string('app_id', 190);
18 18
             $table->integer('user_id');
19 19
             $table->string('app_secret');
Please login to merge, or discard this patch.
routes/api.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,6 +2,6 @@
 block discarded – undo
2 2
 
3 3
 use Yansongda\LaravelApi\Api;
4 4
 
5
-Route::prefix(Api::$routePrefix)->namespace('Yansongda\LaravelApi\Http\Controllers')->group(function () {
5
+Route::prefix(Api::$routePrefix)->namespace('Yansongda\LaravelApi\Http\Controllers')->group(function() {
6 6
     Route::post('token', 'TokenController@issueToken');
7 7
 });
Please login to merge, or discard this patch.
src/Http/Controllers/TokenController.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,8 @@
 block discarded – undo
25 25
     public function issueToken(Request $request)
26 26
     {
27 27
         $app = App::where('app_id', $request->app_id)
28
-                  ->where('app_secret', $request->app_secret)
29
-                  ->first();
28
+                    ->where('app_secret', $request->app_secret)
29
+                    ->first();
30 30
 
31 31
         if (is_null($app)) {
32 32
             throw new InvalidAppException('Invalid App Info');
Please login to merge, or discard this patch.
src/ApiServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
      */
83 83
     protected function registerGuard()
84 84
     {
85
-        Auth::extend('api', function ($app, $name, array $config) {
85
+        Auth::extend('api', function($app, $name, array $config) {
86 86
             return new TokenGuard($app['request']);
87 87
         });
88 88
     }
Please login to merge, or discard this patch.
src/Api.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
      */
81 81
     public static function generateAccessToken($app)
82 82
     {
83
-        if (! ($app instanceof App)) {
83
+        if (!($app instanceof App)) {
84 84
             throw new GenerateAccessTokenException('[' . get_class($app) . '] Must Be An Instance Of [Yansongda\LaravelApi\Models\App]');
85 85
         }
86 86
 
Please login to merge, or discard this patch.
src/Guards/TokenGuard.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      */
60 60
     public function user()
61 61
     {
62
-        if (! is_null($this->user)) {
62
+        if (!is_null($this->user)) {
63 63
             return $this->user;
64 64
         }
65 65
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     public function app()
79 79
     {
80
-        if (! is_null($this->app)) {
80
+        if (!is_null($this->app)) {
81 81
             return $this->app;
82 82
         }
83 83
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
             $token = $this->request->getPassword();
144 144
         }
145 145
 
146
-        if (! empty($token)) {
146
+        if (!empty($token)) {
147 147
             return $token;
148 148
         }
149 149
 
Please login to merge, or discard this patch.