Passed
Push — master ( 5403d4...38a665 )
by Ferry
04:29
created
src/types/select_option/SelectOption.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,10 +21,10 @@
 block discarded – undo
21 21
     public function options($data_options) {
22 22
         $data = columnSingleton()->getColumn($this->index);
23 23
 
24
-        foreach($data_options as $key=>$option) {
25
-            if(is_int($key)) {
24
+        foreach ($data_options as $key=>$option) {
25
+            if (is_int($key)) {
26 26
                 $data_options[$option] = $option;
27
-            }else{
27
+            } else {
28 28
                 $data_options[$key] = $option;
29 29
             }
30 30
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
         foreach($data_options as $key=>$option) {
25 25
             if(is_int($key)) {
26 26
                 $data_options[$option] = $option;
27
-            }else{
27
+            } else{
28 28
                 $data_options[$key] = $option;
29 29
             }
30 30
         }
Please login to merge, or discard this patch.
src/types/select_option/component.blade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
             name="{{ $column->getName() }}" id="{{ $column->getName() }}">
8 8
         <option value="">** Select a {{ $column->getLabel() }}</option>
9 9
         <?php
10
-            $columnValue = old($column->getName())?:($column->getDefaultValue())?:$column->getValue();
10
+            $columnValue = old($column->getName()) ?: ($column->getDefaultValue()) ?: $column->getValue();
11 11
         ?>
12 12
         @foreach($column->getOptions() as $key=>$value)
13 13
             <option {{ $columnValue==$key?'selected':'' }} value="{{ $key }}">{{ $value }}</option>
Please login to merge, or discard this patch.
src/types/select_option/Hook.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
     {
22 22
         $option = $column->getOptions();
23 23
         $key = $row->{ $column->getField() };
24
-        return @$option[ $key ];
24
+        return @$option[$key];
25 25
     }
26 26
 
27 27
     public function detailRender($row, $column)
Please login to merge, or discard this patch.
src/types/select_table/Route.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-cb()->routeGroupBackend(function () {
4
-    cb()->routePost("select-table-lookup",'\crocodicstudio\crudbooster\types\select_table\SelectTableController@postLookup');
3
+cb()->routeGroupBackend(function() {
4
+    cb()->routePost("select-table-lookup", '\crocodicstudio\crudbooster\types\select_table\SelectTableController@postLookup');
5 5
 });
6 6
\ No newline at end of file
Please login to merge, or discard this patch.
src/types/select_table/SelectTable.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,13 +41,13 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public function optionsFromTable($table, $value_option, $display_option, $SQLCondition = null) {
43 43
 
44
-        if(strpos($table,"App\Models")!==false) {
44
+        if (strpos($table, "App\Models") !== false) {
45 45
             $table = new $table();
46 46
             $table = $table::$tableName;
47 47
         }
48 48
 
49 49
         $data = DB::table($table);
50
-        if($SQLCondition && is_callable($SQLCondition)) {
50
+        if ($SQLCondition && is_callable($SQLCondition)) {
51 51
             $data = call_user_func($SQLCondition, $data);
52 52
         }elseif ($SQLCondition && is_string($SQLCondition)) {
53 53
             $data->whereRaw($SQLCondition);
@@ -55,11 +55,11 @@  discard block
 block discarded – undo
55 55
         $data = $data->get();
56 56
         $options = [];
57 57
         foreach ($data as $d) {
58
-            $options[ $d->$value_option ] = $d->$display_option;
58
+            $options[$d->$value_option] = $d->$display_option;
59 59
         }
60 60
         $data = columnSingleton()->getColumn($this->index);
61 61
         /** @var $data SelectTableModel */
62
-        $data->setOptionsFromTable(["table"=>$table,"key_field"=>$value_option,"display_field"=>$display_option,"sql_condition"=>$SQLCondition]);
62
+        $data->setOptionsFromTable(["table"=>$table, "key_field"=>$value_option, "display_field"=>$display_option, "sql_condition"=>$SQLCondition]);
63 63
         columnSingleton()->setColumn($this->index, $data);
64 64
 
65 65
         $this->options($options);
Please login to merge, or discard this patch.
src/types/select_query/component.blade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
             name="{{ $column->getName() }}" id="{{ $column->getName() }}">
8 8
         <option value="">** Select a {{ $column->getLabel() }}</option>
9 9
         <?php
10
-            $columnValue = old($column->getName())?:($column->getDefaultValue())?:$column->getValue();
10
+            $columnValue = old($column->getName()) ?: ($column->getDefaultValue()) ?: $column->getValue();
11 11
         ?>
12 12
         @foreach($column->getOptions() as $key=>$value)
13 13
             <option {{ $columnValue==$key?'selected':'' }} value="{{ $key }}">{{ $value }}</option>
Please login to merge, or discard this patch.
src/types/select_query/SelectQuery.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,16 +29,16 @@
 block discarded – undo
29 29
 
30 30
         columnSingleton()->setColumn($this->index, $data);
31 31
 
32
-        if(is_callable($query)) {
32
+        if (is_callable($query)) {
33 33
             $result = call_user_func($query);
34
-        }else{
34
+        } else {
35 35
             $result = DB::select(DB::raw($query));
36 36
         }
37 37
 
38
-        if($result) {
38
+        if ($result) {
39 39
             $options = [];
40
-            foreach($result as $r) {
41
-                $options[ $r->key ] = $r->label;
40
+            foreach ($result as $r) {
41
+                $options[$r->key] = $r->label;
42 42
             }
43 43
             $this->options($options);
44 44
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 
32 32
         if(is_callable($query)) {
33 33
             $result = call_user_func($query);
34
-        }else{
34
+        } else{
35 35
             $result = DB::select(DB::raw($query));
36 36
         }
37 37
 
Please login to merge, or discard this patch.
src/types/select_query/Hook.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
     {
33 33
         $option = $column->getOptions();
34 34
         $key = $row->{ $column->getField() };
35
-        return @$option[ $key ];
35
+        return @$option[$key];
36 36
     }
37 37
 
38 38
     public function detailRender($row, $column)
Please login to merge, or discard this patch.
src/middlewares/CBBackend.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@
 block discarded – undo
18 18
      */
19 19
     public function handle($request, Closure $next)
20 20
     {
21
-        if(auth()->guest()) {
22
-            return cb()->redirect(cb()->getLoginUrl("login"),trans('cb::cb.please_login_for_first'),'warning');
21
+        if (auth()->guest()) {
22
+            return cb()->redirect(cb()->getLoginUrl("login"), trans('cb::cb.please_login_for_first'), 'warning');
23 23
         }
24 24
 
25 25
         (new CBHook())->beforeBackendMiddleware($request);
Please login to merge, or discard this patch.