Passed
Push — master ( ace8c3...7bd78a )
by Prasanth
01:48
created
database/migrations/2022_08_01_113633_create_otps_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('otps', function (Blueprint $table) {
16
+        Schema::create('otps', function(Blueprint $table) {
17 17
             $table->id();
18 18
             $table->unsignedBigInteger('user_id')->nullable();
19 19
             $table->string('identifier');
Please login to merge, or discard this patch.
src/Otpify.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
         if ($validity === null) $validity = config('otpify.validity');
25 25
 
26 26
         Otp::where([
27
-            ['identifier', $identifier],
28
-            ['otp_type', $otpType]
27
+            [ 'identifier', $identifier ],
28
+            [ 'otp_type', $otpType ]
29 29
         ])->delete();
30 30
 
31 31
         if (($digits >= 4) && ($digits <= 8)) {
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
     public static function validate(string $identifier, string $token, string $otpType = null)
60 60
     {
61 61
         $otp = Otp::where([
62
-            ['identifier', $identifier],
63
-            ['otp_type', $otpType]
62
+            [ 'identifier', $identifier ],
63
+            [ 'otp_type', $otpType ]
64 64
         ])->first();
65 65
 
66 66
         if ($otp == null) {
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,8 +20,12 @@
 block discarded – undo
20 20
      */
21 21
     public static function generate(string $identifier, int $userId = null, string $otpType = null, int $digits = null, int $validity = null)
22 22
     {
23
-        if ($digits === null) $digits = config('otpify.digits');
24
-        if ($validity === null) $validity = config('otpify.validity');
23
+        if ($digits === null) {
24
+            $digits = config('otpify.digits');
25
+        }
26
+        if ($validity === null) {
27
+            $validity = config('otpify.validity');
28
+        }
25 29
 
26 30
         Otp::where([
27 31
             ['identifier', $identifier],
Please login to merge, or discard this patch.