Completed
Push — master ( d46470...2a81af )
by Alexander
02:23
created
src/RandomStr.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
         } else {
95 95
             //by default used this characters
96 96
             $this->char_sets = [
97
-                'abcdefghijklmnopqrstuvwxyz'.
98
-                'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
97
+                'abcdefghijklmnopqrstuvwxyz' .
98
+                'ABCDEFGHIJKLMNOPQRSTUVWXYZ' .
99 99
                 '01234567890_-.'
100 100
                 ];
101 101
         }
@@ -115,11 +115,11 @@  discard block
 block discarded – undo
115 115
             if ($len == \strlen($chars)) {
116 116
                 continue;
117 117
             }
118
-            $arr=[];
118
+            $arr = [];
119 119
             for ($i = 0; $i < $len; $i++) {
120 120
                 $arr[] = \mb_substr($chars, $i, 1, "UTF-8");
121 121
             }
122
-            $this->char_sets[$k]=$arr;
122
+            $this->char_sets[$k] = $arr;
123 123
         }
124 124
     }
125 125
     
@@ -141,14 +141,14 @@  discard block
 block discarded – undo
141 141
      */
142 142
     public function genRandomStr($len = 10, $char_set_num = 0)
143 143
     {
144
-        if (!isset($this->char_sets[$char_set_num]) || $len<1) {
144
+        if (!isset($this->char_sets[$char_set_num]) || $len < 1) {
145 145
             return false;
146 146
         } elseif (is_array($this->char_sets[$char_set_num])) {
147 147
             $l = count($this->char_sets[$char_set_num]);
148 148
         } else {
149 149
             $l = \strlen($this->char_sets[$char_set_num]);
150 150
         }
151
-        if (! $l) {
151
+        if (!$l) {
152 152
             return false;
153 153
         }
154 154
         $outstr = '';
@@ -179,10 +179,10 @@  discard block
 block discarded – undo
179 179
      */
180 180
     public function md5RandomBytes($len)
181 181
     {
182
-        if ($len>0) {
182
+        if ($len > 0) {
183 183
             $start = mt_rand(9, PHP_INT_MAX);
184 184
             $output = '';
185
-            for ($i=$start; strlen($output) < $len; $i++) {
185
+            for ($i = $start; strlen($output) < $len; $i++) {
186 186
                 $output .= md5($i, true);
187 187
             }
188 188
             return substr($output, 0, $len);
Please login to merge, or discard this patch.