Passed
Push — main ( 9bac24...a0c0c8 )
by ikechukwu
02:53
created
src/Console/Commands/RoutesCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,13 +30,13 @@
 block discarded – undo
30 30
     {
31 31
         file_put_contents(
32 32
             base_path('routes/web.php'),
33
-            file_get_contents(__DIR__.'/stubs/Route/web.stub'),
33
+            file_get_contents(__DIR__ . '/stubs/Route/web.stub'),
34 34
             FILE_APPEND
35 35
         );
36 36
 
37 37
         file_put_contents(
38 38
             base_path('routes/api.php'),
39
-            file_get_contents(__DIR__.'/stubs/Route/api.stub'),
39
+            file_get_contents(__DIR__ . '/stubs/Route/api.stub'),
40 40
             FILE_APPEND
41 41
         );
42 42
 
Please login to merge, or discard this patch.
src/Traits/Helpers.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -46,13 +46,13 @@  discard block
 block discarded – undo
46 46
                         'REMOTE_ADDR'
47 47
                     ];
48 48
 
49
-        foreach ($server_keys as $key){
49
+        foreach ($server_keys as $key) {
50 50
             if (array_key_exists($key, $_SERVER) === true) {
51
-                foreach (explode(',', $_SERVER[$key]) as $ip) {
51
+                foreach (explode(',', $_SERVER[ $key ]) as $ip) {
52 52
                     $ip = trim($ip); // just to be safe
53 53
 
54 54
                     if (filter_var($ip, FILTER_VALIDATE_IP,
55
-                        FILTER_FLAG_NO_PRIV_RANGE |
55
+                        FILTER_FLAG_NO_PRIV_RANGE|
56 56
                         FILTER_FLAG_NO_RES_RANGE) !== false
57 57
                     ) {
58 58
                         return $ip;
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
     public function getUserLoginInformation(): array
68 68
     {
69
-        $info = [];
69
+        $info = [ ];
70 70
 
71 71
         if (Browser::deviceType() === 'Mobile' ||
72 72
             Browser::deviceType() === 'Tablet') {
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
         }
91 91
 
92 92
         if ($position = Location::get()) {
93
-            $info[] = $position->countryName;
94
-            $info[] = $position->regionName;
95
-            $info[] = $position->cityName;
93
+            $info[ ] = $position->countryName;
94
+            $info[ ] = $position->regionName;
95
+            $info[ ] = $position->cityName;
96 96
         }
97 97
 
98 98
         return $info;
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
 
101 101
     public function unknownErrorResponse(): JsonResponse
102 102
     {
103
-        $data = ['message' =>
104
-        trans('sanctumauthstarter::general.unknown_error')];
103
+        $data = [ 'message' =>
104
+        trans('sanctumauthstarter::general.unknown_error') ];
105 105
 
106 106
         return $this->httpJsonResponse(
107 107
             trans('sanctumauthstarter::general.fail'), 422, $data);
@@ -109,10 +109,10 @@  discard block
 block discarded – undo
109 109
 
110 110
     public function generateSalt(int $length = 9, bool $add_dashes = false, string $available_sets = 'luds'): string
111 111
     {
112
-        [$sets, $salt, $all] = $this->saltsAllVar($available_sets);
112
+        [ $sets, $salt, $all ] = $this->saltsAllVar($available_sets);
113 113
 
114
-        for($i = 0; $i < $length - count($sets); $i++) {
115
-            $salt .= $all[array_rand($all)];
114
+        for ($i = 0; $i < $length - count($sets); $i++) {
115
+            $salt .= $all[ array_rand($all) ];
116 116
         }
117 117
 
118 118
         $salt = str_shuffle($salt);
@@ -128,8 +128,8 @@  discard block
 block discarded – undo
128 128
         if ($this->throttleRequestsService->hasTooManyAttempts($request)) {
129 129
             $this->throttleRequestsService->_fireLockoutEvent($request);
130 130
 
131
-            return ["message" => trans($trans,
132
-                        ['seconds' =>
131
+            return [ "message" => trans($trans,
132
+                        [ 'seconds' =>
133 133
                             $this->throttleRequestsService->_limiter()
134 134
                             ->availableIn(
135 135
                                     $this->throttleRequestsService
@@ -144,12 +144,12 @@  discard block
 block discarded – undo
144 144
         return null;
145 145
     }
146 146
 
147
-    public function returnTwoFactorLoginView(array $data = []): View
147
+    public function returnTwoFactorLoginView(array $data = [ ]): View
148 148
     {
149
-        $data['input'] = '2fa_code';
149
+        $data[ 'input' ] = '2fa_code';
150 150
 
151 151
         if (!array_key_exists("message", $data)) {
152
-            $data['message'] = trans('sanctumauthstarter::auth.failed');
152
+            $data[ 'message' ] = trans('sanctumauthstarter::auth.failed');
153 153
         }
154 154
 
155 155
         return view('two-factor::login', $data);
@@ -166,22 +166,22 @@  discard block
 block discarded – undo
166 166
 
167 167
     private function stringSets(string $available_sets): array
168 168
     {
169
-        $sets = [];
169
+        $sets = [ ];
170 170
 
171 171
         if (strpos($available_sets, 'l') !== false) {
172
-            $sets[] = 'abcdefghjkmnpqrstuvwxyz';
172
+            $sets[ ] = 'abcdefghjkmnpqrstuvwxyz';
173 173
         }
174 174
 
175 175
         if (strpos($available_sets, 'u') !== false) {
176
-            $sets[] = 'ABCDEFGHJKMNPQRSTUVWXYZ';
176
+            $sets[ ] = 'ABCDEFGHJKMNPQRSTUVWXYZ';
177 177
         }
178 178
 
179 179
         if (strpos($available_sets, 'd') !== false) {
180
-            $sets[] = '23456789';
180
+            $sets[ ] = '23456789';
181 181
         }
182 182
 
183 183
         if (strpos($available_sets, 's') !== false) {
184
-            $sets[] = '!@#$%&*?';
184
+            $sets[ ] = '!@#$%&*?';
185 185
         }
186 186
 
187 187
         return $sets;
@@ -195,11 +195,11 @@  discard block
 block discarded – undo
195 195
 
196 196
         foreach ($sets as $set)
197 197
         {
198
-            $salt .= $set[array_rand(str_split($set))];
198
+            $salt .= $set[ array_rand(str_split($set)) ];
199 199
             $all .= $set;
200 200
         }
201 201
 
202
-        return [$sets, $salt, str_split($all)];
202
+        return [ $sets, $salt, str_split($all) ];
203 203
     }
204 204
 
205 205
     private function addDashes(string $salt, int $length): string
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
         $dash_len = floor(sqrt($length));
208 208
         $dash_str = '';
209 209
 
210
-        while(strlen($salt) > $dash_len)
210
+        while (strlen($salt) > $dash_len)
211 211
         {
212 212
             $dash_str .= substr($salt, 0, $dash_len) . '-';
213 213
             $salt = substr($salt, $dash_len);
Please login to merge, or discard this patch.
src/Rules/DisallowOldPassword.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
      */
65 65
     public function message()
66 66
     {
67
-        return trans_choice('sanctumauthstarter::passwords.exists', intval(is_int($this->checkAll)), ['number' => $this->number]);
67
+        return trans_choice('sanctumauthstarter::passwords.exists', intval(is_int($this->checkAll)), [ 'number' => $this->number ]);
68 68
     }
69 69
 
70 70
     /**
Please login to merge, or discard this patch.
src/Listeners/SendResetLink.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,6 +12,6 @@
 block discarded – undo
12 12
     public function handle($event)
13 13
     {
14 14
         $this->event = $event;
15
-        Password::sendResetLink(['email' => $this->event->user->email]);
15
+        Password::sendResetLink([ 'email' => $this->event->user->email ]);
16 16
     }
17 17
 }
Please login to merge, or discard this patch.
src/Console/Commands/TestsCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,17 +31,17 @@
 block discarded – undo
31 31
      */
32 32
     public function handle()
33 33
     {
34
-        if (! is_dir($directory = base_path('tests/Feature'))) {
34
+        if (!is_dir($directory = base_path('tests/Feature'))) {
35 35
             mkdir($directory, 0755, true);
36 36
         }
37 37
 
38 38
         $filesystem = new Filesystem;
39 39
 
40
-        collect($filesystem->allFiles(__DIR__.'/stubs/Tests'))
41
-            ->each(function (SplFileInfo $file) use ($filesystem) {
40
+        collect($filesystem->allFiles(__DIR__ . '/stubs/Tests'))
41
+            ->each(function(SplFileInfo $file) use ($filesystem) {
42 42
                 $filesystem->copy(
43 43
                     $file->getPathname(),
44
-                    base_path('tests/Feature/'.Str::replaceLast('.stub', '.php', $file->getFilename()))
44
+                    base_path('tests/Feature/' . Str::replaceLast('.stub', '.php', $file->getFilename()))
45 45
                 );
46 46
             });
47 47
 
Please login to merge, or discard this patch.
src/SanctumauthstarterServiceProvider.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,11 +18,11 @@  discard block
 block discarded – undo
18 18
      * @return void
19 19
      */
20 20
 
21
-    public const LANG = __DIR__.'/lang';
22
-    public const DB = __DIR__.'/migrations';
23
-    public const VIEW = __DIR__.'/views';
24
-    public const CONFIG = __DIR__.'/config/sanctumauthstarter.php';
25
-    public const ACTION = __DIR__.'/.github/workflows';
21
+    public const LANG = __DIR__ . '/lang';
22
+    public const DB = __DIR__ . '/migrations';
23
+    public const VIEW = __DIR__ . '/views';
24
+    public const CONFIG = __DIR__ . '/config/sanctumauthstarter.php';
25
+    public const ACTION = __DIR__ . '/.github/workflows';
26 26
 
27 27
     public function boot()
28 28
     {
@@ -64,12 +64,12 @@  discard block
 block discarded – undo
64 64
     public function register()
65 65
     {
66 66
         $this->mergeConfigFrom(
67
-            __DIR__.'/config/sanctumauthstarter.php', 'sanctumauthstarter'
67
+            __DIR__ . '/config/sanctumauthstarter.php', 'sanctumauthstarter'
68 68
         );
69 69
 
70 70
         $this->app->register(EventServiceProvider::class);
71 71
 
72
-        $this->app->bind(ThrottleRequestsService::class, function (Application $app) {
72
+        $this->app->bind(ThrottleRequestsService::class, function(Application $app) {
73 73
             return new ThrottleRequestsService(
74 74
                 config('sanctumauthstarter.login.maxAttempts', 3),
75 75
                 config('sanctumauthstarter.login.delayMinutes', 1)
Please login to merge, or discard this patch.
src/Notifications/WelcomeUser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@
 block discarded – undo
18 18
     public function toMail($notifiable)
19 19
     {
20 20
         return (new MailMessage)
21
-                    ->subject(trans('sanctumauthstarter::notify.welcome.subject', ['name' => $this->user->name]))
22
-                    ->line(trans('sanctumauthstarter::notify.welcome.introduction', ['name' => $this->user->name]))
21
+                    ->subject(trans('sanctumauthstarter::notify.welcome.subject', [ 'name' => $this->user->name ]))
22
+                    ->line(trans('sanctumauthstarter::notify.welcome.introduction', [ 'name' => $this->user->name ]))
23 23
                     ->line(trans('sanctumauthstarter::notify.welcome.message'))
24 24
                     ->action(trans('sanctumauthstarter::notify.welcome.action'), url(config('sanctumauthstarter.notification_url.registration.welcome_user')))
25 25
                     ->line(trans('sanctumauthstarter::notify.welcome.complimentary_close'));
Please login to merge, or discard this patch.
src/Notifications/UserLogin.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
     {
20 20
         return (new MailMessage)
21 21
             ->subject(trans('sanctumauthstarter::notify.login.subject'))
22
-            ->line(trans('sanctumauthstarter::notify.login.introduction', ['time' => $this->time, 'deviceAndLocation' => $this->deviceAndLocation]))
22
+            ->line(trans('sanctumauthstarter::notify.login.introduction', [ 'time' => $this->time, 'deviceAndLocation' => $this->deviceAndLocation ]))
23 23
             ->line(trans('sanctumauthstarter::notify.login.message'))
24 24
             ->action(trans('sanctumauthstarter::notify.login.action'), route(config('sanctumauthstarter.notification_url.login.user_login')))
25 25
             ->line(trans('sanctumauthstarter::notify.login.complimentary_close'));
Please login to merge, or discard this patch.