Completed
Push — master ( 9e4436...7d48d7 )
by MeWebStudio - Muharrem
13s
created
src/Captcha.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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,10 +212,10 @@  discard block
 block discarded – undo
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
         
218
-        if (app()->version() >= 5.5){
218
+        if (app()->version() >= 5.5) {
219 219
             $this->fonts = array_map(function($file) {
220 220
                 return $file->getPathName();
221 221
             }, $this->fonts);
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
         $characters = str_split($this->characters);
292 292
 
293 293
         $bag = '';
294
-        for($i = 0; $i < $this->length; $i++)
294
+        for ($i = 0; $i < $this->length; $i++)
295 295
         {
296 296
             $bag .= $characters[rand(0, count($characters) - 1)];
297 297
         }
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
         $marginTop = $this->image->height() / $this->length;
313 313
 
314 314
         $i = 0;
315
-        foreach(str_split($this->text) as $char)
315
+        foreach (str_split($this->text) as $char)
316 316
         {
317 317
             $marginLeft = ($i * $this->image->width() / $this->length);
318 318
 
@@ -385,14 +385,14 @@  discard block
 block discarded – undo
385 385
      */
386 386
     protected function lines()
387 387
     {
388
-        for($i = 0; $i <= $this->lines; $i++)
388
+        for ($i = 0; $i <= $this->lines; $i++)
389 389
         {
390 390
             $this->image->line(
391 391
                 rand(0, $this->image->width()) + $i * rand(0, $this->image->height()),
392 392
                 rand(0, $this->image->height()),
393 393
                 rand(0, $this->image->width()),
394 394
                 rand(0, $this->image->height()),
395
-                function ($draw) {
395
+                function($draw) {
396 396
                     $draw->color($this->fontColor());
397 397
                 }
398 398
             );
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
      */
434 434
     public function src($config = null)
435 435
     {
436
-        return url('captcha' . ($config ? '/' . $config : '/default')) . '?' . $this->str->random(8);
436
+        return url('captcha'.($config ? '/'.$config : '/default')).'?'.$this->str->random(8);
437 437
     }
438 438
 
439 439
     /**
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
      */
445 445
     public function img($config = null)
446 446
     {
447
-        return '<img src="' . $this->src($config) . '" alt="captcha">';
447
+        return '<img src="'.$this->src($config).'" alt="captcha">';
448 448
     }
449 449
 
450 450
 }
Please login to merge, or discard this patch.