Passed
Push — master ( d8be30...a36b4c )
by IRFA
03:55
created
src/Controller/AppLicenseController.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -11,18 +11,18 @@
 block discarded – undo
11 11
 {
12 12
     public function check(Request $request,License $license,Json $json)
13 13
     {
14
-    	if(empty($request->serial))
15
-    	{
16
-    		$data['active'] = false;
17
-    		$data['message'] = "Serial number must be provided.";
18
-    		return $json->response(400,'data',$data,[]); 
19
-    	}
20
-    	$res = $license->serial($request->serial)->check();
14
+        if(empty($request->serial))
15
+        {
16
+            $data['active'] = false;
17
+            $data['message'] = "Serial number must be provided.";
18
+            return $json->response(400,'data',$data,[]); 
19
+        }
20
+        $res = $license->serial($request->serial)->check();
21 21
         if($res->active)
22 22
         {
23
-    	   return $json->response(200,'data',$res,[]); 
23
+            return $json->response(200,'data',$res,[]); 
24 24
         } 
25
-           return $json->response(400,'data',$res,[$res->message]); 
25
+            return $json->response(400,'data',$res,[$res->message]); 
26 26
 
27 27
     }
28 28
 }
Please login to merge, or discard this patch.
src/Core/Json.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
 class Json
8 8
 {
9
-   public  function response($status, $key_data = 'data', $data=null, $errors=null)
9
+    public  function response($status, $key_data = 'data', $data=null, $errors=null)
10 10
     {
11 11
         return response()->json([
12 12
             'status'    => $status,
Please login to merge, or discard this patch.
src/Core/SerialGenerator.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -8,26 +8,26 @@
 block discarded – undo
8 8
 
9 9
 class SerialGenerator extends SerialType
10 10
 {
11
-	protected function generateSerial()
11
+    protected function generateSerial()
12 12
     {
13
-    	if(config('irfa.app_license_server.char_type') == "alphanumeric") {
13
+        if(config('irfa.app_license_server.char_type') == "alphanumeric") {
14 14
 
15
-			return $this->alphanumeric();
15
+            return $this->alphanumeric();
16 16
 
17
-    	} elseif(config('irfa.app_license_server.char_type') == "numeric") {
17
+        } elseif(config('irfa.app_license_server.char_type') == "numeric") {
18 18
 
19
-			return $this->numeric();
19
+            return $this->numeric();
20 20
 
21
-    	} 
22
-    	elseif(config('irfa.app_license_server.char_type') == "alphabet") {
21
+        } 
22
+        elseif(config('irfa.app_license_server.char_type') == "alphabet") {
23 23
 
24
-    		return $this->alphabet();
24
+            return $this->alphabet();
25 25
 
26
-		} else {
27
-			throw new \Exception('\''.config('irfa.app_license_server.char_type').'\' is not supported, supported char type : alphanumeric, numeric, or alphabet');
26
+        } else {
27
+            throw new \Exception('\''.config('irfa.app_license_server.char_type').'\' is not supported, supported char type : alphanumeric, numeric, or alphabet');
28 28
 
29
-			return false;
30
-		}
29
+            return false;
30
+        }
31 31
       
32 32
     }
33 33
 
Please login to merge, or discard this patch.
src/Core/SerialType.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@
 block discarded – undo
20 20
 
21 21
         return $sn;
22 22
     }
23
-	protected function alphanumeric()
23
+    protected function alphanumeric()
24 24
     {
25
-    	return $this->sn()->setConfig([   
25
+        return $this->sn()->setConfig([   
26 26
                                 'length'            => config('irfa.app_license_server.length'),
27 27
                                 'segment'           => config('irfa.app_license_server.segment'),
28 28
                                 'seperator'         => $this->seperator,
Please login to merge, or discard this patch.
src/Core/SerialManager.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -89,12 +89,12 @@  discard block
 block discarded – undo
89 89
 
90 90
     protected function disableSN($sn)
91 91
     {
92
-         return LicenseSerial::where('serial',$sn)->update(['status'=>1]);
92
+            return LicenseSerial::where('serial',$sn)->update(['status'=>1]);
93 93
     }
94 94
 
95 95
     protected function enableSN($sn)
96 96
     {
97
-         return LicenseSerial::where('serial',$sn)->update(['status'=>0]);
97
+            return LicenseSerial::where('serial',$sn)->update(['status'=>0]);
98 98
     }
99 99
 
100 100
     protected function renewSN($sn,$days)
@@ -112,6 +112,6 @@  discard block
 block discarded – undo
112 112
 
113 113
         }
114 114
         $return['message'] = "Renew serial number Failed because serial number not exists.";
115
-         return $return;
115
+            return $return;
116 116
     }
117 117
 }
Please login to merge, or discard this patch.
src/Func/License.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
     public function disable()
24 24
     {
25
-         return $this->disableSN($this->serial);
25
+            return $this->disableSN($this->serial);
26 26
     }
27 27
 
28 28
     public function enable()
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
                 return (object)['active' => false,'message' => "Serial Number is Disabled"];
50 50
             }
51 51
 
52
-             return (object)['active' => true,'message' => "Serial Number is valid"];
52
+                return (object)['active' => true,'message' => "Serial Number is valid"];
53 53
         } else{
54 54
             return (object)['active' => false,'message' => "Serial Number invalid"];
55 55
         }
Please login to merge, or discard this patch.
src/Models/LicenseSerial.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,6 +6,6 @@
 block discarded – undo
6 6
 
7 7
 class LicenseSerial extends Model
8 8
 {
9
-	protected $table = 'license_serials';
9
+    protected $table = 'license_serials';
10 10
     protected $fillable = ['name','domain','phone_number','address','serial','expired','status'];	
11 11
 }
Please login to merge, or discard this patch.
config/irfa/app_license_server.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php 
2
-	return [ 
2
+    return [ 
3 3
 
4
-	/*
4
+    /*
5 5
     |--------------------------------------------------------------------------
6 6
     | License Route
7 7
     |--------------------------------------------------------------------------
@@ -10,9 +10,9 @@  discard block
 block discarded – undo
10 10
     | https://yoursite.com/check/license
11 11
     |
12 12
     */
13
-	'license_route'		=> '/check/license',
13
+    'license_route'		=> '/check/license',
14 14
 
15
-	/*
15
+    /*
16 16
     |--------------------------------------------------------------------------
17 17
     | Route name
18 18
     |--------------------------------------------------------------------------
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
     | Set route name for checking serial number.
21 21
     |
22 22
     */
23
-	'route_name'		=> 'check_license',
23
+    'route_name'		=> 'check_license',
24 24
 
25
-	/*
25
+    /*
26 26
     |--------------------------------------------------------------------------
27 27
     | Character Type
28 28
     |--------------------------------------------------------------------------
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
     |
35 35
     */
36 36
 
37
-	'char_type'			=> 'alphanumeric', //Type alphanumeric
37
+    'char_type'			=> 'alphanumeric', //Type alphanumeric
38 38
 
39
-	/*
39
+    /*
40 40
     |--------------------------------------------------------------------------
41 41
     | Serial Config
42 42
     |--------------------------------------------------------------------------
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
     | striped 	: striped segment for serial
47 47
     |
48 48
     */
49
-		'length'			=> 4,//default : 4
49
+        'length'			=> 4,//default : 4
50 50
 
51
-		'segment'			=> 4,//default : 4
51
+        'segment'			=> 4,//default : 4
52 52
 
53
-		'striped'			=> true,//default : true
53
+        'striped'			=> true,//default : true
54 54
 
55 55
 
56 56
 
Please login to merge, or discard this patch.