Passed
Pull Request — master (#129)
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.
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.
routes/routes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
     [
7 7
         'middleware' => config('magiclink.middlewares'),
8 8
     ],
9
-    function () {
9
+    function() {
10 10
         Route::get(
11 11
             config('magiclink.url.validate_path', 'magiclink').'/{token}',
12 12
             'MagicLink\Controllers\MagicLinkController@access'
Please login to merge, or discard this patch.
src/MagicLinkServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     {
29 29
         $rateLimit = config('magiclink.rate_limit', 100);
30 30
 
31
-        RateLimiter::for(
31
+        RateLimiter::for (
32 32
             'magiclink',
33 33
             fn () => $rateLimit === 'none'
34 34
                 ? Limit::none()
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
     private function offerPublishing(): void
56 56
     {
57
-        if (! $this->app->runningInConsole()) {
57
+        if ( ! $this->app->runningInConsole()) {
58 58
             return;
59 59
         }
60 60
 
Please login to merge, or discard this patch.
src/MagicLink.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     {
45 45
         parent::boot();
46 46
 
47
-        static::creating(function ($model) {
47
+        static::creating(function($model) {
48 48
             $model->id = Str::uuid();
49 49
         });
50 50
     }
@@ -74,14 +74,14 @@  discard block
 block discarded – undo
74 74
 
75 75
     public function baseUrl(?string $baseUrl): self
76 76
     {
77
-        $this->attributes['base_url'] = rtrim($baseUrl, '/') . '/';
77
+        $this->attributes['base_url'] = rtrim($baseUrl, '/').'/';
78 78
 
79 79
         return $this;
80 80
     }
81 81
 
82 82
     public function getUrlAttribute(): string
83 83
     {
84
-        $baseUrl = rtrim($this->attributes['base_url'] ?? '', '/') . '/'; // Use the stored base_url or an empty string
84
+        $baseUrl = rtrim($this->attributes['base_url'] ?? '', '/').'/'; // Use the stored base_url or an empty string
85 85
 
86 86
         return url(sprintf(
87 87
             '%s%s/%s%s%s',
@@ -176,12 +176,12 @@  discard block
 block discarded – undo
176 176
 
177 177
         return static::where('id', $tokenId)
178 178
                     ->where('token', $tokenSecret)
179
-                    ->where(function ($query) {
179
+                    ->where(function($query) {
180 180
                         $query
181 181
                             ->whereNull('available_at')
182 182
                             ->orWhere('available_at', '>=', Carbon::now());
183 183
                     })
184
-                    ->where(function ($query) {
184
+                    ->where(function($query) {
185 185
                         $query
186 186
                             ->whereNull('max_visits')
187 187
                             ->orWhereRaw('max_visits > num_visits');
@@ -215,10 +215,10 @@  discard block
 block discarded – undo
215 215
      */
216 216
     public static function deleteMagicLinkExpired()
217 217
     {
218
-        $query = MagicLink::where(function ($query) {
218
+        $query = MagicLink::where(function($query) {
219 219
             $query
220 220
                 ->where('available_at', '<', Carbon::now())
221
-                ->orWhere(function ($query) {
221
+                ->orWhere(function($query) {
222 222
                     $query
223 223
                         ->whereNotNull('max_visits')
224 224
                         ->whereRaw('max_visits <= num_visits');
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
         }
233 233
 
234 234
 
235
-        $query->get()->each(function (MagicLink $magiclink) {
235
+        $query->get()->each(function(MagicLink $magiclink) {
236 236
             $magiclink->delete();
237 237
 
238 238
             event(new MagicLinkWasDeleted($magiclink));
Please login to merge, or discard this patch.