@@ -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); |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | $characters = str_split($this->characters); |
| 297 | 297 | |
| 298 | 298 | $bag = ''; |
| 299 | - for($i = 0; $i < $this->length; $i++) |
|
| 299 | + for ($i = 0; $i < $this->length; $i++) |
|
| 300 | 300 | { |
| 301 | 301 | $bag .= $characters[rand(0, count($characters) - 1)]; |
| 302 | 302 | } |
@@ -317,9 +317,9 @@ discard block |
||
| 317 | 317 | $marginTop = $this->image->height() / $this->length; |
| 318 | 318 | |
| 319 | 319 | $i = 0; |
| 320 | - foreach(str_split($this->text) as $char) |
|
| 320 | + foreach (str_split($this->text) as $char) |
|
| 321 | 321 | { |
| 322 | - $marginLeft = $this->textLeftPadding + ($i * ($this->image->width() - $this->textLeftPadding) / $this->length); |
|
| 322 | + $marginLeft = $this->textLeftPadding + ($i * ($this->image->width() - $this->textLeftPadding) / $this->length); |
|
| 323 | 323 | |
| 324 | 324 | $this->image->text($char, $marginLeft, $marginTop, function($font) { |
| 325 | 325 | $font->file($this->font()); |
@@ -390,14 +390,14 @@ discard block |
||
| 390 | 390 | */ |
| 391 | 391 | protected function lines() |
| 392 | 392 | { |
| 393 | - for($i = 0; $i <= $this->lines; $i++) |
|
| 393 | + for ($i = 0; $i <= $this->lines; $i++) |
|
| 394 | 394 | { |
| 395 | 395 | $this->image->line( |
| 396 | 396 | rand(0, $this->image->width()) + $i * rand(0, $this->image->height()), |
| 397 | 397 | rand(0, $this->image->height()), |
| 398 | 398 | rand(0, $this->image->width()), |
| 399 | 399 | rand(0, $this->image->height()), |
| 400 | - function ($draw) { |
|
| 400 | + function($draw) { |
|
| 401 | 401 | $draw->color($this->fontColor()); |
| 402 | 402 | } |
| 403 | 403 | ); |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | */ |
| 439 | 439 | public function src($config = null) |
| 440 | 440 | { |
| 441 | - return url('captcha' . ($config ? '/' . $config : '/default')) . '?' . $this->str->random(8); |
|
| 441 | + return url('captcha'.($config ? '/'.$config : '/default')).'?'.$this->str->random(8); |
|
| 442 | 442 | } |
| 443 | 443 | |
| 444 | 444 | /** |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | */ |
| 450 | 450 | public function img($config = null) |
| 451 | 451 | { |
| 452 | - return '<img src="' . $this->src($config) . '" alt="captcha">'; |
|
| 452 | + return '<img src="'.$this->src($config).'" alt="captcha">'; |
|
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | } |