Passed
Pull Request — master (#125)
by Cesar
03:00
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/AccessCode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
     {
86 86
         $accessCodeCookies = request()->cookie($this->cookieName);
87 87
 
88
-        if (! $accessCodeCookies) {
88
+        if ( ! $accessCodeCookies) {
89 89
             return null;
90 90
         }
91 91
 
Please login to merge, or discard this patch.
src/Actions/DownloadFileAction.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     public function __construct(string $path, ?string $name = null, array $headers = [])
23 23
     {
24 24
         $this->path = $path;
25
-        if (! is_null($name)) {
25
+        if ( ! is_null($name)) {
26 26
             $this->name($name);
27 27
         }
28 28
         $this->headers($headers);
Please login to merge, or discard this patch.
routes/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/MagicLink.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     {
44 44
         parent::boot();
45 45
 
46
-        static::creating(function ($model) {
46
+        static::creating(function($model) {
47 47
             $model->id = Str::uuid();
48 48
         });
49 49
     }
@@ -73,13 +73,13 @@  discard block
 block discarded – undo
73 73
 
74 74
     public function baseUrl(?string $baseUrl): self
75 75
     {
76
-        $this->attributes['base_url'] = rtrim($baseUrl, '/') . '/';
76
+        $this->attributes['base_url'] = rtrim($baseUrl, '/').'/';
77 77
         return $this;
78 78
     }
79 79
 
80 80
     public function getUrlAttribute(): string
81 81
     {
82
-        $baseUrl = rtrim($this->attributes['base_url'] ?? '', '/') . '/'; // Use the stored base_url or an empty string
82
+        $baseUrl = rtrim($this->attributes['base_url'] ?? '', '/').'/'; // Use the stored base_url or an empty string
83 83
 
84 84
         return url(sprintf(
85 85
             '%s%s/%s%s%s',
@@ -174,12 +174,12 @@  discard block
 block discarded – undo
174 174
 
175 175
         return static::where('id', $tokenId)
176 176
                     ->where('token', $tokenSecret)
177
-                    ->where(function ($query) {
177
+                    ->where(function($query) {
178 178
                         $query
179 179
                             ->whereNull('available_at')
180 180
                             ->orWhere('available_at', '>=', Carbon::now());
181 181
                     })
182
-                    ->where(function ($query) {
182
+                    ->where(function($query) {
183 183
                         $query
184 184
                             ->whereNull('max_visits')
185 185
                             ->orWhereRaw('max_visits > num_visits');
@@ -213,10 +213,10 @@  discard block
 block discarded – undo
213 213
      */
214 214
     public static function deleteMagicLinkExpired()
215 215
     {
216
-        static::where(function ($query) {
216
+        static::where(function($query) {
217 217
             $query
218 218
                 ->where('available_at', '<', Carbon::now())
219
-                ->orWhere(function ($query) {
219
+                ->orWhere(function($query) {
220 220
                     $query
221 221
                         ->whereNotNull('max_visits')
222 222
                         ->whereRaw('max_visits <= num_visits');
Please login to merge, or discard this patch.
databases/migrations/2024_12_25_000000_add_indexes_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->index('available_at');
18 18
             $table->index('max_visits');
19 19
         });
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      */
27 27
     public function down()
28 28
     {
29
-        Schema::table('magic_links', function (Blueprint $table) {
29
+        Schema::table('magic_links', function(Blueprint $table) {
30 30
             $table->dropIndex('magic_links_available_at_index');
31 31
             $table->dropIndex('magic_links_max_visits_index');
32 32
         });
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
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
             return response()->noContent($magicLink ? 200 : 404);
20 20
         }
21 21
 
22
-        if (! $magicLink) {
22
+        if ( ! $magicLink) {
23 23
             return $this->badResponse();
24 24
         }
25 25
 
Please login to merge, or discard this patch.