Completed
Pull Request — master (#300)
by
unknown
16s
created
src/Captcha.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
         $this->backgrounds = $this->files->files(__DIR__.'/../assets/backgrounds');
255 255
         $this->fonts       = $this->files->files($this->fontsDirectory);
256 256
 
257
-        $this->fonts = array_map(function (SplFileInfo $file) {
257
+        $this->fonts = array_map(function(SplFileInfo $file) {
258 258
             return $file->getPathName();
259 259
         }, $this->fonts);
260 260
 
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
         foreach (str_split($this->text) as $key => $char) {
367 367
             $marginLeft = $this->textLeftPadding + ($key * ($this->image->width() - $this->textLeftPadding) / strlen($this->text));
368 368
 
369
-            $this->image->text($char, $marginLeft, $marginTop, function (FontFactory $font) {
369
+            $this->image->text($char, $marginLeft, $marginTop, function(FontFactory $font) {
370 370
                 $font->file($this->font());
371 371
                 $font->size($this->fontSize());
372 372
                 $font->color($this->fontColor());
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
      */
405 405
     private function fontColor(): string
406 406
     {
407
-        if (! empty($this->fontColors)) {
407
+        if ( ! empty($this->fontColors)) {
408 408
             $color = $this->fontColors[rand(0, count($this->fontColors) - 1)];
409 409
         } else {
410 410
             $color = '#'.str_pad(dechex(mt_rand(0, 0xFFFFFF)), 6, '0', STR_PAD_LEFT);
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
     private function lines()
432 432
     {
433 433
         for ($i = 0; $i <= $this->lines; $i++) {
434
-            $this->image->drawLine(function (LineFactory $line) use ($i) {
434
+            $this->image->drawLine(function(LineFactory $line) use ($i) {
435 435
                 $line->from(rand(0, $this->image->width()) + $i * rand(0, $this->image->height()),
436 436
                     rand(0, $this->image->height()));
437 437
                 $line->to(rand(0, $this->image->width()), rand(0, $this->image->height()));
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
      */
452 452
     public function check(string $value): bool
453 453
     {
454
-        if (! $this->session->has('captcha')) {
454
+        if ( ! $this->session->has('captcha')) {
455 455
             return false;
456 456
         }
457 457
 
@@ -459,12 +459,12 @@  discard block
 block discarded – undo
459 459
         $sensitive = $this->session->get('captcha.sensitive');
460 460
         $encrypt   = $this->session->get('captcha.encrypt');
461 461
 
462
-        if (! Cache::pull($this->get_cache_key($key))) {
462
+        if ( ! Cache::pull($this->get_cache_key($key))) {
463 463
             $this->session->remove('captcha');
464 464
             return false;
465 465
         }
466 466
 
467
-        if (! $sensitive) {
467
+        if ( ! $sensitive) {
468 468
             $value = $this->str->lower($value);
469 469
         }
470 470
 
@@ -500,13 +500,13 @@  discard block
 block discarded – undo
500 500
      */
501 501
     public function check_api($value, $key, $config = 'default'): bool
502 502
     {
503
-        if (! Cache::pull($this->get_cache_key($key))) {
503
+        if ( ! Cache::pull($this->get_cache_key($key))) {
504 504
             return false;
505 505
         }
506 506
 
507 507
         $this->configure($config);
508 508
 
509
-        if (! $this->sensitive) {
509
+        if ( ! $this->sensitive) {
510 510
             $value = $this->str->lower($value);
511 511
         }
512 512
         if ($this->encrypt) {
Please login to merge, or discard this patch.