Test Failed
Pull Request — master (#43)
by Cesar
14:34
created
databases/migrations/2017_07_06_000000_create_table_magic_links.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(config('magiclink.magiclink_table', 'magic_links'), function (Blueprint $table) {
16
+        Schema::create(config('magiclink.magiclink_table', 'magic_links'), function(Blueprint $table) {
17 17
             $table->uuid('id')->primary();
18 18
             $table->string('token', 255);
19 19
             $table->text('action');
Please login to merge, or discard this patch.
migrations/2021_03_06_211907_add_access_code_to_magic_links_table.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::table('magic_links', function (Blueprint $table) {
16
+        Schema::table('magic_links', function(Blueprint $table) {
17 17
             $table->string('access_code')->nullable();
18 18
         });
19 19
     }
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     public function down()
27 27
     {
28 28
         if (Schema::hasColumn('magic_links', 'access_code')) {
29
-            Schema::table('magic_links', function (Blueprint $table) {
29
+            Schema::table('magic_links', function(Blueprint $table) {
30 30
                 $table->dropColumn('access_code');
31 31
             });
32 32
         }
Please login to merge, or discard this patch.
src/routes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
             'web',
11 11
         ],
12 12
     ],
13
-    function () {
13
+    function() {
14 14
         Route::get(
15 15
             config('magiclink.url.validate_path', 'magiclink').'/{token}',
16 16
             'MagicLink\Controllers\MagicLinkController@access'
Please login to merge, or discard this patch.
src/Middlewares/MagiclinkMiddleware.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 
18 18
         $magicLink = MagicLink::getValidMagicLinkByToken($token);
19 19
 
20
-        if (! $magicLink) {
20
+        if ( ! $magicLink) {
21 21
             return $this->badResponse();
22 22
         }
23 23
 
Please login to merge, or discard this patch.
src/MagicLink.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     {
23 23
         parent::boot();
24 24
 
25
-        static::creating(function ($model) {
25
+        static::creating(function($model) {
26 26
             $model->id = Str::uuid();
27 27
         });
28 28
     }
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
      */
119 119
     public function protectedWithAcessCode(): bool
120 120
     {
121
-        return !is_null($this->access_code ?? null);
121
+        return ! is_null($this->access_code ?? null);
122 122
     }
123 123
 
124 124
     /**
@@ -163,12 +163,12 @@  discard block
 block discarded – undo
163 163
 
164 164
         return self::where('id', $tokenId)
165 165
                     ->where('token', $tokenSecret)
166
-                    ->where(function ($query) {
166
+                    ->where(function($query) {
167 167
                         $query
168 168
                             ->whereNull('available_at')
169 169
                             ->orWhere('available_at', '>=', Carbon::now());
170 170
                     })
171
-                    ->where(function ($query) {
171
+                    ->where(function($query) {
172 172
                         $query
173 173
                             ->whereNull('max_visits')
174 174
                             ->orWhereRaw('max_visits > num_visits');
@@ -203,10 +203,10 @@  discard block
 block discarded – undo
203 203
      */
204 204
     public static function deleteMagicLinkExpired()
205 205
     {
206
-        self::where(function ($query) {
206
+        self::where(function($query) {
207 207
             $query
208 208
                 ->where('available_at', '<', Carbon::now())
209
-                ->orWhere(function ($query) {
209
+                ->orWhere(function($query) {
210 210
                     $query
211 211
                         ->whereNotNull('max_visits')
212 212
                         ->whereRaw('max_visits <= num_visits');
Please login to merge, or discard this patch.