@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | */ |
| 141 | 141 | public function countArrayValuesRecursive(&$arr, $cnt = 0) |
| 142 | 142 | { |
| 143 | - \array_walk_recursive($arr, function ($v, $k) use (&$cnt) { |
|
| 143 | + \array_walk_recursive($arr, function($v, $k) use (&$cnt) { |
|
| 144 | 144 | $cnt++; |
| 145 | 145 | }); |
| 146 | 146 | return $cnt; |
@@ -160,9 +160,9 @@ discard block |
||
| 160 | 160 | return false; |
| 161 | 161 | } |
| 162 | 162 | $m_depth = $c_depth; |
| 163 | - \array_walk($arr, function ($v, $k) use ($c_depth, &$m_depth) { |
|
| 163 | + \array_walk($arr, function($v, $k) use ($c_depth, &$m_depth) { |
|
| 164 | 164 | if (is_array($v)) { |
| 165 | - $new_depth = $this->countArrayMaxDepth($v, $c_depth+1); |
|
| 165 | + $new_depth = $this->countArrayMaxDepth($v, $c_depth + 1); |
|
| 166 | 166 | if ($new_depth > $m_depth) { |
| 167 | 167 | $m_depth = $new_depth; |
| 168 | 168 | } |
@@ -223,9 +223,9 @@ discard block |
||
| 223 | 223 | if (empty($chars)) { |
| 224 | 224 | //Numeric values model |
| 225 | 225 | $this->values_model = 1; |
| 226 | - if (!$min && $max==65535) { |
|
| 226 | + if (!$min && $max == 65535) { |
|
| 227 | 227 | //Non-changes values model (random number from 0 to 65535) |
| 228 | - $this->values_model=0; |
|
| 228 | + $this->values_model = 0; |
|
| 229 | 229 | } |
| 230 | 230 | } else { |
| 231 | 231 | //Random-string values model |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | if ($lim_elements) { |
| 297 | 297 | $this->lim_elements = $lim_elements; |
| 298 | 298 | } |
| 299 | - if ($lim_depth<1 |
|
| 299 | + if ($lim_depth < 1 |
|
| 300 | 300 | || $this->lim_elements < 0 |
| 301 | 301 | || $this->max_arr_key < 0 |
| 302 | 302 | || $this->max_arr_key < $this->min_arr_key |
@@ -311,11 +311,11 @@ discard block |
||
| 311 | 311 | $elem_cnt = $this->lim_elements; |
| 312 | 312 | } |
| 313 | 313 | $r_arr = []; |
| 314 | - $gen_arr = \unpack('v*', \call_user_func($this->rnd_fn, $elem_cnt*2)); |
|
| 315 | - $this->lim_elements-=$elem_cnt; |
|
| 314 | + $gen_arr = \unpack('v*', \call_user_func($this->rnd_fn, $elem_cnt * 2)); |
|
| 315 | + $this->lim_elements -= $elem_cnt; |
|
| 316 | 316 | |
| 317 | 317 | foreach ($gen_arr as $k => $v) { |
| 318 | - if ($v > $threshold || $lim_depth<2 || $this->lim_elements <2) { |
|
| 318 | + if ($v > $threshold || $lim_depth < 2 || $this->lim_elements < 2) { |
|
| 319 | 319 | if ($this->values_model) { |
| 320 | 320 | if ($this->values_model == 3) { |
| 321 | 321 | $v = \call_user_func($this->fn_gen_value, |
@@ -116,11 +116,11 @@ discard block |
||
| 116 | 116 | if ($len == \strlen($chars)) { |
| 117 | 117 | continue; |
| 118 | 118 | } |
| 119 | - $arr=[]; |
|
| 119 | + $arr = []; |
|
| 120 | 120 | for ($i = 0; $i < $len; $i++) { |
| 121 | 121 | $arr[] = \mb_substr($chars, $i, 1, "UTF-8"); |
| 122 | 122 | } |
| 123 | - $this->char_sets[$k]=$arr; |
|
| 123 | + $this->char_sets[$k] = $arr; |
|
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | |
@@ -180,10 +180,10 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | public function md5RandomBytes($len) |
| 182 | 182 | { |
| 183 | - if ($len>0) { |
|
| 183 | + if ($len > 0) { |
|
| 184 | 184 | $start = mt_rand(9, PHP_INT_MAX); |
| 185 | 185 | $output = ''; |
| 186 | - for ($i=$start; strlen($output) < $len; $i++) { |
|
| 186 | + for ($i = $start; strlen($output) < $len; $i++) { |
|
| 187 | 187 | $output .= md5($i, true); |
| 188 | 188 | } |
| 189 | 189 | return substr($output, 0, $len); |