@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $this->session = $session; |
187 | 187 | $this->hasher = $hasher; |
188 | 188 | $this->str = $str; |
189 | - $this->characters = config('captcha.characters','2346789abcdefghjmnpqrtuxyzABCDEFGHJMNPQRTUXYZ'); |
|
189 | + $this->characters = config('captcha.characters', '2346789abcdefghjmnpqrtuxyzABCDEFGHJMNPQRTUXYZ'); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | /** |
@@ -195,9 +195,9 @@ discard block |
||
195 | 195 | */ |
196 | 196 | protected function configure($config) |
197 | 197 | { |
198 | - if ($this->config->has('captcha.' . $config)) |
|
198 | + if ($this->config->has('captcha.'.$config)) |
|
199 | 199 | { |
200 | - foreach($this->config->get('captcha.' . $config) as $key => $val) |
|
200 | + foreach ($this->config->get('captcha.'.$config) as $key => $val) |
|
201 | 201 | { |
202 | 202 | $this->{$key} = $val; |
203 | 203 | } |
@@ -212,8 +212,8 @@ discard block |
||
212 | 212 | */ |
213 | 213 | public function create($config = 'default') |
214 | 214 | { |
215 | - $this->backgrounds = $this->files->files(__DIR__ . '/../assets/backgrounds'); |
|
216 | - $this->fonts = $this->files->files(__DIR__ . '/../assets/fonts'); |
|
215 | + $this->backgrounds = $this->files->files(__DIR__.'/../assets/backgrounds'); |
|
216 | + $this->fonts = $this->files->files(__DIR__.'/../assets/fonts'); |
|
217 | 217 | $this->fonts = array_values($this->fonts); //reset fonts array index |
218 | 218 | |
219 | 219 | $this->configure($config); |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | $characters = str_split($this->characters); |
285 | 285 | |
286 | 286 | $bag = ''; |
287 | - for($i = 0; $i < $this->length; $i++) |
|
287 | + for ($i = 0; $i < $this->length; $i++) |
|
288 | 288 | { |
289 | 289 | $bag .= $characters[rand(0, count($characters) - 1)]; |
290 | 290 | } |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | $marginTop = $this->image->height() / $this->length; |
306 | 306 | |
307 | 307 | $i = 0; |
308 | - foreach(str_split($this->text) as $char) |
|
308 | + foreach (str_split($this->text) as $char) |
|
309 | 309 | { |
310 | 310 | $marginLeft = ($i * $this->image->width() / $this->length); |
311 | 311 | |
@@ -378,14 +378,14 @@ discard block |
||
378 | 378 | */ |
379 | 379 | protected function lines() |
380 | 380 | { |
381 | - for($i = 0; $i <= $this->lines; $i++) |
|
381 | + for ($i = 0; $i <= $this->lines; $i++) |
|
382 | 382 | { |
383 | 383 | $this->image->line( |
384 | 384 | rand(0, $this->image->width()) + $i * rand(0, $this->image->height()), |
385 | 385 | rand(0, $this->image->height()), |
386 | 386 | rand(0, $this->image->width()), |
387 | 387 | rand(0, $this->image->height()), |
388 | - function ($draw) { |
|
388 | + function($draw) { |
|
389 | 389 | $draw->color($this->fontColor()); |
390 | 390 | } |
391 | 391 | ); |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | */ |
427 | 427 | public function src($config = null) |
428 | 428 | { |
429 | - return url('captcha' . ($config ? '/' . $config : '/default')) . '?' . $this->str->random(8); |
|
429 | + return url('captcha'.($config ? '/'.$config : '/default')).'?'.$this->str->random(8); |
|
430 | 430 | } |
431 | 431 | |
432 | 432 | /** |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | */ |
438 | 438 | public function img($config = null) |
439 | 439 | { |
440 | - return '<img src="' . $this->src($config) . '" alt="captcha">'; |
|
440 | + return '<img src="'.$this->src($config).'" alt="captcha">'; |
|
441 | 441 | } |
442 | 442 | |
443 | 443 | } |