@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | $this->session = $session; |
| 192 | 192 | $this->hasher = $hasher; |
| 193 | 193 | $this->str = $str; |
| 194 | - $this->characters = config('captcha.characters','2346789abcdefghjmnpqrtuxyzABCDEFGHJMNPQRTUXYZ'); |
|
| 194 | + $this->characters = config('captcha.characters', '2346789abcdefghjmnpqrtuxyzABCDEFGHJMNPQRTUXYZ'); |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | /** |
@@ -200,9 +200,9 @@ discard block |
||
| 200 | 200 | */ |
| 201 | 201 | protected function configure($config) |
| 202 | 202 | { |
| 203 | - if ($this->config->has('captcha.' . $config)) |
|
| 203 | + if ($this->config->has('captcha.'.$config)) |
|
| 204 | 204 | { |
| 205 | - foreach($this->config->get('captcha.' . $config) as $key => $val) |
|
| 205 | + foreach ($this->config->get('captcha.'.$config) as $key => $val) |
|
| 206 | 206 | { |
| 207 | 207 | $this->{$key} = $val; |
| 208 | 208 | } |
@@ -217,10 +217,10 @@ discard block |
||
| 217 | 217 | */ |
| 218 | 218 | public function create($config = 'default') |
| 219 | 219 | { |
| 220 | - $this->backgrounds = $this->files->files(__DIR__ . '/../assets/backgrounds'); |
|
| 221 | - $this->fonts = $this->files->files(__DIR__ . '/../assets/fonts'); |
|
| 220 | + $this->backgrounds = $this->files->files(__DIR__.'/../assets/backgrounds'); |
|
| 221 | + $this->fonts = $this->files->files(__DIR__.'/../assets/fonts'); |
|
| 222 | 222 | |
| 223 | - if (app()->version() >= 5.5){ |
|
| 223 | + if (app()->version() >= 5.5) { |
|
| 224 | 224 | $this->fonts = array_map(function($file) { |
| 225 | 225 | return $file->getPathName(); |
| 226 | 226 | }, $this->fonts); |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | $marginTop = $this->image->height() / $this->length; |
| 328 | 328 | |
| 329 | 329 | $i = 0; |
| 330 | - foreach(str_split($this->text) as $char) |
|
| 330 | + foreach (str_split($this->text) as $char) |
|
| 331 | 331 | { |
| 332 | 332 | $marginLeft = ($i * $this->image->width() / $this->length); |
| 333 | 333 | |
@@ -400,14 +400,14 @@ discard block |
||
| 400 | 400 | */ |
| 401 | 401 | protected function lines() |
| 402 | 402 | { |
| 403 | - for($i = 0; $i <= $this->lines; $i++) |
|
| 403 | + for ($i = 0; $i <= $this->lines; $i++) |
|
| 404 | 404 | { |
| 405 | 405 | $this->image->line( |
| 406 | 406 | rand(0, $this->image->width()) + $i * rand(0, $this->image->height()), |
| 407 | 407 | rand(0, $this->image->height()), |
| 408 | 408 | rand(0, $this->image->width()), |
| 409 | 409 | rand(0, $this->image->height()), |
| 410 | - function ($draw) { |
|
| 410 | + function($draw) { |
|
| 411 | 411 | $draw->color($this->fontColor()); |
| 412 | 412 | } |
| 413 | 413 | ); |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | */ |
| 449 | 449 | public function src($config = null) |
| 450 | 450 | { |
| 451 | - return url('captcha' . ($config ? '/' . $config : '/default')) . '?' . $this->str->random(8); |
|
| 451 | + return url('captcha'.($config ? '/'.$config : '/default')).'?'.$this->str->random(8); |
|
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | /** |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | */ |
| 460 | 460 | public function img($config = null) |
| 461 | 461 | { |
| 462 | - return '<img src="' . $this->src($config) . '" alt="captcha">'; |
|
| 462 | + return '<img src="'.$this->src($config).'" alt="captcha">'; |
|
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | } |