Completed
Push — master ( 3aa97c...0f0372 )
by Maxime
12s
created
src/Distilleries/Expendable/Listeners/BaseListener.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
     {
21 21
         foreach ($this->events as $name => $event)
22 22
         {
23
-            Event::listen($name, get_class($this) . '@' . $event['action'], $event['priority']);
23
+            Event::listen($name, get_class($this).'@'.$event['action'], $event['priority']);
24 24
         }
25 25
 
26 26
     }
Please login to merge, or discard this patch.
src/Distilleries/Expendable/Helpers/StaticLabel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
 
62 62
         foreach ($dataActions as $action)
63 63
         {
64
-            $dataResult[$action] = trans('expendable::mail.' . $action);
64
+            $dataResult[$action] = trans('expendable::mail.'.$action);
65 65
         }
66 66
 
67 67
         return self::getLabel($dataResult, $id);
Please login to merge, or discard this patch.
src/Distilleries/Expendable/Console/ComponentMakeCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -227,6 +227,6 @@
 block discarded – undo
227 227
      */
228 228
     protected function getStub()
229 229
     {
230
-        return __DIR__ . '/Lib/stubs/' . $this->getTemplate() . '.stub';
230
+        return __DIR__.'/Lib/stubs/'.$this->getTemplate().'.stub';
231 231
     }
232 232
 }
233 233
\ No newline at end of file
Please login to merge, or discard this patch.
src/Distilleries/Expendable/Console/Lib/Generators/ComponentGenerator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
         $model = last($model);
9 9
         $model = preg_replace('/\.php/i', '', $model);
10 10
 
11
-        return '\\' . $model;
11
+        return '\\'.$model;
12 12
 
13 13
     }
14 14
 
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
         {
21 21
             $state = preg_replace('/Contracts/i', 'States', $state);
22 22
             $state = preg_replace('/Contract/i', 'Trait', $state);
23
-            $result .= 'use ' . $state . ';' . "\n";
23
+            $result .= 'use '.$state.';'."\n";
24 24
         }
25 25
 
26 26
         return $result;
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
     public function getImplementation($states)
31 31
     {
32
-        $result = 'implements ' . join(', ', $states);
32
+        $result = 'implements '.join(', ', $states);
33 33
 
34 34
         return $result;
35 35
 
Please login to merge, or discard this patch.
src/Distilleries/Expendable/Models/LockableTrait.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
         $this->{$this->column_nb_of_try_name} += 1;
20 20
         \DB::table($this->getTable())
21
-            ->where($this->getKeyName(),$this->getKey())
21
+            ->where($this->getKeyName(), $this->getKey())
22 22
             ->increment($this->column_nb_of_try_name);
23 23
         return $this;
24 24
 
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
     {
29 29
 
30 30
         \DB::table($this->getTable())
31
-            ->where($this->getKeyName(),$this->getKey())
32
-            ->decrement($this->column_nb_of_try_name,$this->{$this->column_nb_of_try_name});
31
+            ->where($this->getKeyName(), $this->getKey())
32
+            ->decrement($this->column_nb_of_try_name, $this->{$this->column_nb_of_try_name});
33 33
 
34 34
         $this->{$this->column_nb_of_try_name} = 0;
35 35
         return $this;
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
         $this->{$this->column_nb_of_try_name} = config($this->config_key_security_lock) + 1;
42 42
 
43 43
         \DB::table($this->getTable())
44
-            ->where($this->getKeyName(),$this->getKey())
45
-            ->increment($this->column_nb_of_try_name,$this->{$this->column_nb_of_try_name} );
44
+            ->where($this->getKeyName(), $this->getKey())
45
+            ->increment($this->column_nb_of_try_name, $this->{$this->column_nb_of_try_name} );
46 46
 
47 47
         return $this;
48 48
     }
Please login to merge, or discard this patch.
src/Distilleries/Expendable/Http/Middleware/XSS.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 
14 14
         $input = $request->all();
15 15
 
16
-        array_walk_recursive($input, function (&$input) {
16
+        array_walk_recursive($input, function(&$input) {
17 17
 
18 18
             $input = (new Security)->xss_clean($input);
19 19
 
Please login to merge, or discard this patch.
src/Distilleries/Expendable/Helpers/Security.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
             // do the long opening tags.
170 170
             $str = preg_replace('/<\?(php)/i', "&lt;?\\1", $str);
171 171
         } else {
172
-            $str = str_replace(['<?', '?' . '>'], ['&lt;?', '?&gt;'], $str);
172
+            $str = str_replace(['<?', '?'.'>'], ['&lt;?', '?&gt;'], $str);
173 173
         }
174 174
 
175 175
         /*
@@ -195,12 +195,12 @@  discard block
 block discarded – undo
195 195
             $temp = '';
196 196
 
197 197
             for ($i = 0, $wordlen = strlen($word); $i < $wordlen; $i++) {
198
-                $temp .= substr($word, $i, 1) . "\s*";
198
+                $temp .= substr($word, $i, 1)."\s*";
199 199
             }
200 200
 
201 201
             // We only want to do this when it is followed by a non-word character
202 202
             // That way valid stuff like "dealer to" does not become "dealerto"
203
-            $str = preg_replace_callback('#(' . substr($temp, 0, -3) . ')(\W)#is', [$this, '_compact_exploded_words'], $str);
203
+            $str = preg_replace_callback('#('.substr($temp, 0, -3).')(\W)#is', [$this, '_compact_exploded_words'], $str);
204 204
         }
205 205
 
206 206
         /*
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
            * Becomes: &lt;blink&gt;
241 241
            */
242 242
         $naughty = 'alert|applet|audio|basefont|base|behavior|bgsound|blink|body|embed|expression|form|frameset|frame|head|html|ilayer|iframe|input|isindex|layer|link|meta|object|plaintext|style|script|textarea|title|video|xml|xss';
243
-        $str     = preg_replace_callback('#<(/*\s*)(' . $naughty . ')([^><]*)([><]*)#is', [$this, '_sanitize_naughty_html'], $str);
243
+        $str     = preg_replace_callback('#<(/*\s*)('.$naughty.')([^><]*)([><]*)#is', [$this, '_sanitize_naughty_html'], $str);
244 244
 
245 245
         /*
246 246
            * Sanitize naughty scripting elements
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 
316 316
         do {
317 317
             $str = preg_replace(
318
-                "#<(/?[^><]+?)([^A-Za-z\-])(" . implode('|', $evil_attributes) . ")(\s*=\s*)([\"][^>]*?[\"]|[\'][^>]*?[\']|[^>]*?)([\s><])([><]*)#i",
318
+                "#<(/?[^><]+?)([^A-Za-z\-])(".implode('|', $evil_attributes).")(\s*=\s*)([\"][^>]*?[\"]|[\'][^>]*?[\']|[^>]*?)([\s><])([><]*)#i",
319 319
                 "<$1$6",
320 320
                 $str, -1, $count
321 321
             );
@@ -386,17 +386,17 @@  discard block
 block discarded – undo
386 386
             '?',
387 387
             "%20",
388 388
             "%22",
389
-            "%3c",        // <
390
-            "%253c",    // <
391
-            "%3e",        // >
392
-            "%0e",        // >
393
-            "%28",        // (
394
-            "%29",        // )
395
-            "%2528",    // (
396
-            "%26",        // &
397
-            "%24",        // $
398
-            "%3f",        // ?
399
-            "%3b",        // ;
389
+            "%3c", // <
390
+            "%253c", // <
391
+            "%3e", // >
392
+            "%0e", // >
393
+            "%28", // (
394
+            "%29", // )
395
+            "%2528", // (
396
+            "%26", // &
397
+            "%24", // $
398
+            "%3f", // ?
399
+            "%3b", // ;
400 400
             "%3d"        // =
401 401
         ];
402 402
 
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
      */
424 424
     protected function _compact_exploded_words($matches)
425 425
     {
426
-        return preg_replace('/\s+/s', '', $matches[1]) . $matches[2];
426
+        return preg_replace('/\s+/s', '', $matches[1]).$matches[2];
427 427
     }
428 428
 
429 429
     // --------------------------------------------------------------------
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
     protected function _sanitize_naughty_html($matches)
440 440
     {
441 441
         // encode opening brace
442
-        $str = '&lt;' . $matches[1] . $matches[2] . $matches[3];
442
+        $str = '&lt;'.$matches[1].$matches[2].$matches[3];
443 443
 
444 444
         // encode captured opening or closing brace to prevent recursive vectors
445 445
         $str .= str_replace(['>', '<'], ['&gt;', '&lt;'],
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
 
572 572
         // 901119URL5918AMP18930PROTECT8198
573 573
 
574
-        $str = preg_replace('|\&([a-z\_0-9\-]+)\=([a-z\_0-9\-]+)|i', $this->xss_hash() . "\\1=\\2", $str);
574
+        $str = preg_replace('|\&([a-z\_0-9\-]+)\=([a-z\_0-9\-]+)|i', $this->xss_hash()."\\1=\\2", $str);
575 575
 
576 576
         /*
577 577
          * Validate standard character entities
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
         $str = str_replace(array_keys($this->_never_allowed_str), $this->_never_allowed_str, $str);
610 610
 
611 611
         foreach ($this->_never_allowed_regex as $regex) {
612
-            $str = preg_replace('#' . $regex . '#is', '[removed]', $str);
612
+            $str = preg_replace('#'.$regex.'#is', '[removed]', $str);
613 613
         }
614 614
 
615 615
         return $str;
@@ -624,11 +624,11 @@  discard block
 block discarded – undo
624 624
         // carriage return (dec 13), and horizontal tab (dec 09)
625 625
 
626 626
         if ($url_encoded) {
627
-            $non_displayables[] = '/%0[0-8bcef]/';    // url encoded 00-08, 11, 12, 14, 15
628
-            $non_displayables[] = '/%1[0-9a-f]/';    // url encoded 16-31
627
+            $non_displayables[] = '/%0[0-8bcef]/'; // url encoded 00-08, 11, 12, 14, 15
628
+            $non_displayables[] = '/%1[0-9a-f]/'; // url encoded 16-31
629 629
         }
630 630
 
631
-        $non_displayables[] = '/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S';    // 00-08, 11, 12, 14-31, 127
631
+        $non_displayables[] = '/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S'; // 00-08, 11, 12, 14-31, 127
632 632
 
633 633
         do {
634 634
             $str = preg_replace($non_displayables, '', $str, -1, $count);
Please login to merge, or discard this patch.
src/Distilleries/Expendable/Models/BaseModel.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -520,16 +520,16 @@  discard block
 block discarded – undo
520 520
     public function scopeSearch($query, $searchQuery)
521 521
     {
522 522
 
523
-        return $query->where(function ($query) use ($searchQuery) {
523
+        return $query->where(function($query) use ($searchQuery) {
524 524
             $columns = $this->getAllColumnsNames();
525 525
 
526 526
             foreach ($columns as $column) {
527
-                $column = $this->isReserved($column) ? '"' . $column . '"' : $column;
527
+                $column = $this->isReserved($column) ? '"'.$column.'"' : $column;
528 528
 
529 529
                 if ((DB::connection()->getDriverName()) == 'oracle') {
530
-                    $query->orWhereRaw('LOWER(' . $column . ') like ? ESCAPE \'\\\'', ['%' . Security::escapeLike(strtolower($searchQuery)) . '%']);
530
+                    $query->orWhereRaw('LOWER('.$column.') like ? ESCAPE \'\\\'', ['%'.Security::escapeLike(strtolower($searchQuery)).'%']);
531 531
                 } else {
532
-                    $query->orwhere($column, 'like', '%' . Security::escapeLike($searchQuery,'\\\'') . '%');
532
+                    $query->orwhere($column, 'like', '%'.Security::escapeLike($searchQuery, '\\\'').'%');
533 533
                 }
534 534
 
535 535
             }
@@ -540,13 +540,13 @@  discard block
 block discarded – undo
540 540
     {
541 541
         switch (DB::connection()->getDriverName()) {
542 542
             case 'pgsql':
543
-                $query       = "SELECT column_name FROM information_schema.columns WHERE table_name = '" . $this->getTable() . "'";
543
+                $query       = "SELECT column_name FROM information_schema.columns WHERE table_name = '".$this->getTable()."'";
544 544
                 $column_name = 'column_name';
545 545
                 $reverse     = true;
546 546
                 break;
547 547
 
548 548
             case 'mysql':
549
-                $query       = 'SHOW COLUMNS FROM ' . $this->getTable();
549
+                $query       = 'SHOW COLUMNS FROM '.$this->getTable();
550 550
                 $column_name = 'Field';
551 551
                 $reverse     = false;
552 552
                 break;
@@ -555,17 +555,17 @@  discard block
 block discarded – undo
555 555
                 $parts       = explode('.', $this->getTable());
556 556
                 $num         = (count($parts) - 1);
557 557
                 $table       = $parts[$num];
558
-                $query       = "SELECT column_name FROM " . DB::connection()->getConfig('database') . ".INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = N'" . $table . "'";
558
+                $query       = "SELECT column_name FROM ".DB::connection()->getConfig('database').".INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = N'".$table."'";
559 559
                 $column_name = 'column_name';
560 560
                 $reverse     = false;
561 561
                 break;
562 562
             case 'oracle':
563
-                $query       = 'SELECT COLUMN_NAME from ALL_TAB_COLUMNS WHERE TABLE_NAME=\'' . strtoupper($this->getTable()) . '\' AND DATA_TYPE <> \'CLOB\' AND DATA_TYPE <> \'NUMBER\' AND DATA_TYPE <> \'TIMESTAMP\'';
563
+                $query       = 'SELECT COLUMN_NAME from ALL_TAB_COLUMNS WHERE TABLE_NAME=\''.strtoupper($this->getTable()).'\' AND DATA_TYPE <> \'CLOB\' AND DATA_TYPE <> \'NUMBER\' AND DATA_TYPE <> \'TIMESTAMP\'';
564 564
                 $column_name = 'column_name';
565 565
                 $reverse     = false;
566 566
                 break;
567 567
             default:
568
-                $error = 'Database driver not supported: ' . DB::connection()->getConfig('driver');
568
+                $error = 'Database driver not supported: '.DB::connection()->getConfig('driver');
569 569
                 throw new Exception($error);
570 570
         }
571 571
 
@@ -584,12 +584,12 @@  discard block
 block discarded – undo
584 584
 
585 585
     public function scopeBetweenCreate($query, $start, $end)
586 586
     {
587
-        return $query->whereBetween($this->getTable() . '.created_at', [$start, $end]);
587
+        return $query->whereBetween($this->getTable().'.created_at', [$start, $end]);
588 588
     }
589 589
 
590 590
     public function scopeBetweenUpdate($query, $start, $end)
591 591
     {
592
-        return $query->whereBetween($this->getTable() . '.updated_at', [$start, $end]);
592
+        return $query->whereBetween($this->getTable().'.updated_at', [$start, $end]);
593 593
     }
594 594
 
595 595
 
Please login to merge, or discard this patch.
src/Distilleries/Expendable/Http/Router/Router.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
         // First, we will check to see if a controller prefix has been registered in
43 43
         // the route group. If it has, we will need to prefix it before trying to
44 44
         // reflect into the class instance and pull out the method for routing.
45
-        if (! empty($this->groupStack)) {
45
+        if (!empty($this->groupStack)) {
46 46
             $prepended = $this->prependGroupUses($controller);
47 47
         }
48 48
         $routable = (new ControllerInspector)
Please login to merge, or discard this patch.