Passed
Push — master ( b77c96...a63077 )
by IRFA
01:35
created
src/SerialNumberGeneratorSeviceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
     public function boot()
25 25
     {
26 26
         $this->publishes([
27
-            __DIR__.'/../config/irfa/' => config_path('irfa')],'php-serial-number');
27
+            __DIR__.'/../config/irfa/' => config_path('irfa')], 'php-serial-number');
28 28
 
29 29
         
30 30
     }
Please login to merge, or discard this patch.
src/Core/ConfigInit.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,16 +23,16 @@
 block discarded – undo
23 23
 
24 24
     private function setConfig()
25 25
     {
26
-         if (function_exists('config') and function_exists('app')) {//Load Config For Laravel
26
+            if (function_exists('config') and function_exists('app')) {//Load Config For Laravel
27 27
             if(!empty(config('irfa.serial_number'))) 
28 28
             {
29 29
                 $this->laravelConfig();
30 30
             } else{
31 31
                 $this->generalConfig();
32 32
             }
33
-       } else{//Load Config for Non-Laravel
33
+        } else{//Load Config for Non-Laravel
34 34
             $this->generalConfig();
35
-       }
35
+        }
36 36
     }
37 37
     private function laravelConfig()
38 38
     {
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@  discard block
 block discarded – undo
11 11
     protected $seperator;
12 12
     protected $charset;
13 13
 
14
-    protected function runConfig($config_array=null)
14
+    protected function runConfig($config_array = null)
15 15
     {
16
-        if(empty($config_array))
16
+        if (empty($config_array))
17 17
         {
18 18
             $this->setConfig();
19 19
         } else {
@@ -24,13 +24,13 @@  discard block
 block discarded – undo
24 24
     private function setConfig()
25 25
     {
26 26
          if (function_exists('config') and function_exists('app')) {//Load Config For Laravel
27
-            if(!empty(config('irfa.serial_number'))) 
27
+            if (!empty(config('irfa.serial_number'))) 
28 28
             {
29 29
                 $this->laravelConfig();
30
-            } else{
30
+            } else {
31 31
                 $this->generalConfig();
32 32
             }
33
-       } else{//Load Config for Non-Laravel
33
+       } else {//Load Config for Non-Laravel
34 34
             $this->generalConfig();
35 35
        }
36 36
     }
@@ -56,10 +56,10 @@  discard block
 block discarded – undo
56 56
     {
57 57
         require dirname(__DIR__, 2)."/config/config.php";
58 58
 
59
-        $this->length       = isset($arr['length']) ? $arr['length']:$config['length'];
60
-        $this->segment      = isset($arr['segment']) ? $arr['segment']:$config['segment'];
61
-        $this->seperator    = isset($arr['seperator']) ? $arr['seperator']:$config['seperator']; 
62
-        $this->charset      = isset($arr['charset']) ? $arr['charset']:$config['charset']; 
59
+        $this->length       = isset($arr['length']) ? $arr['length'] : $config['length'];
60
+        $this->segment      = isset($arr['segment']) ? $arr['segment'] : $config['segment'];
61
+        $this->seperator    = isset($arr['seperator']) ? $arr['seperator'] : $config['seperator']; 
62
+        $this->charset      = isset($arr['charset']) ? $arr['charset'] : $config['charset']; 
63 63
     }
64 64
 
65 65
 }
Please login to merge, or discard this patch.
src/Core/SN.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@
 block discarded – undo
11 11
 
12 12
     protected function generateSN($json=false)
13 13
     {
14
-    	if($json)
15
-    	{
16
-    		return json_encode(['sn'=>$this->generatingSN()]);
17
-    	}
14
+        if($json)
15
+        {
16
+            return json_encode(['sn'=>$this->generatingSN()]);
17
+        }
18 18
         return $this->generatingSN();
19 19
     }
20 20
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@
 block discarded – undo
9 9
     private $generated_serial;
10 10
     private $serial;
11 11
 
12
-    protected function generateSN($json=false)
12
+    protected function generateSN($json = false)
13 13
     {
14
-    	if($json)
14
+    	if ($json)
15 15
     	{
16 16
     		return json_encode(['sn'=>$this->generatingSN()]);
17 17
     	}
Please login to merge, or discard this patch.
src/Func/SerialNumber.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
 
11 11
 class SerialNumber extends SN
12 12
 {
13
-    private array $config=[];
13
+    private array $config = [];
14 14
 
15 15
     public function generate($json_return = false)
16 16
     {
Please login to merge, or discard this patch.
config/irfa/serial_number.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php 
2
-	return [ 
3
-	/*
2
+    return [ 
3
+    /*
4 4
     |--------------------------------------------------------------------------
5 5
     | Serial Config
6 6
     |--------------------------------------------------------------------------
@@ -10,9 +10,9 @@  discard block
 block discarded – undo
10 10
     | seperator : striped segment for serial (set null if you do not wish to use seperator)
11 11
     |
12 12
     */
13
-		'length'			=> 4, //default : 4 (result:ABCD)
13
+        'length'			=> 4, //default : 4 (result:ABCD)
14 14
 
15
-		'segment'			=> 4, //default : 4 (result:ABCD-1234-A1B2-CDEF)
15
+        'segment'			=> 4, //default : 4 (result:ABCD-1234-A1B2-CDEF)
16 16
 
17 17
         'seperator'         => "-", //default : - (result : ABCD-1234-A1B2-CDEF)
18 18
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 
17 17
         'seperator'         => "-", //default : - (result : ABCD-1234-A1B2-CDEF)
18 18
 
19
-        'charset'           => "0123456789ABCDEFGHIJKLMNPQRSTUWXYZ",  //default : 0123456789ABCDEFGHIJKLMNPQRSTUWXYZ
19
+        'charset'           => "0123456789ABCDEFGHIJKLMNPQRSTUWXYZ", //default : 0123456789ABCDEFGHIJKLMNPQRSTUWXYZ
20 20
 
21 21
 
22 22
 ];
Please login to merge, or discard this patch.
config/config.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php 
2
-	$config =  [ 
3
-            	/*
2
+    $config =  [ 
3
+                /*
4 4
                 |--------------------------------------------------------------------------
5 5
                 | Serial Config
6 6
                 |--------------------------------------------------------------------------
@@ -10,9 +10,9 @@  discard block
 block discarded – undo
10 10
                 | seperator : striped segment for serial (set null if you do not wish to use seperator)
11 11
                 |
12 12
                 */
13
-            		'length'			=> 4, //default : 4 (result:ABCD)
13
+                    'length'			=> 4, //default : 4 (result:ABCD)
14 14
 
15
-            		'segment'			=> 4, //default : 4 (result:ABCD-1234-A1B2-CDEF)
15
+                    'segment'			=> 4, //default : 4 (result:ABCD-1234-A1B2-CDEF)
16 16
 
17 17
                     'seperator'         => "-", //default : - (result : ABCD-1234-A1B2-CDEF)
18 18
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php 
2
-	$config =  [ 
2
+	$config = [ 
3 3
             	/*
4 4
                 |--------------------------------------------------------------------------
5 5
                 | Serial Config
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
                     'seperator'         => "-", //default : - (result : ABCD-1234-A1B2-CDEF)
18 18
 
19
-                    'charset'           => "0123456789ABCDEFGHIJKLMNPQRSTUWXYZ",//default : 0123456789ABCDEFGHIJKLMNPQRSTUWXYZ
19
+                    'charset'           => "0123456789ABCDEFGHIJKLMNPQRSTUWXYZ", //default : 0123456789ABCDEFGHIJKLMNPQRSTUWXYZ
20 20
 
21 21
 
22 22
 
Please login to merge, or discard this patch.
src/Core/SerialNumberGenerator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,16 +10,16 @@
 block discarded – undo
10 10
 {
11 11
     private $sn;
12 12
 
13
-    function __construct($config_array=null)
13
+    function __construct($config_array = null)
14 14
     {
15 15
         $this->runConfig($config_array);
16 16
     }
17 17
 
18 18
     protected function generatingSN()
19 19
     {
20
-        for($i=1;$i<=intval($this->segment);$i++)
20
+        for ($i = 1; $i<=intval($this->segment); $i++)
21 21
         {
22
-            $this->sn .= $this->sn()->formattedId($this->charset,intval($this->length)).$this->seperator;
22
+            $this->sn .= $this->sn()->formattedId($this->charset, intval($this->length)).$this->seperator;
23 23
         }
24 24
 
25 25
         $sn = $this->sn;
Please login to merge, or discard this patch.