We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | // otherwise assume the arguments are actually the configuration array |
47 | 47 | $config = []; |
48 | 48 | |
49 | - if (! is_array($arg)) { |
|
50 | - if (! class_exists($arg)) { |
|
49 | + if (!is_array($arg)) { |
|
50 | + if (!class_exists($arg)) { |
|
51 | 51 | return response()->json(['error' => 'Class: '.$arg.' does not exists'], 500); |
52 | 52 | } |
53 | 53 | $config['model'] = $arg; |
@@ -77,8 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | if ($search_string === false) { |
79 | 79 | return ($config['paginate'] !== false) ? |
80 | - $config['query']->paginate($config['paginate']) : |
|
81 | - $config['query']->get(); |
|
80 | + $config['query']->paginate($config['paginate']) : $config['query']->get(); |
|
82 | 81 | } |
83 | 82 | |
84 | 83 | $textColumnTypes = ['string', 'json_string', 'text', 'longText', 'json_array', 'json']; |
@@ -89,8 +88,8 @@ discard block |
||
89 | 88 | // .... 'query' => function($model) { return $model->where('active', 1); } |
90 | 89 | // So it reads: SELECT ... WHERE active = 1 AND (XXX = x OR YYY = y) and not SELECT ... WHERE active = 1 AND XXX = x OR YYY = y; |
91 | 90 | |
92 | - if (! empty($config['query']->getQuery()->wheres)) { |
|
93 | - $config['query'] = $config['query']->where(function ($query) use ($model_instance, $config, $search_string, $textColumnTypes) { |
|
91 | + if (!empty($config['query']->getQuery()->wheres)) { |
|
92 | + $config['query'] = $config['query']->where(function($query) use ($model_instance, $config, $search_string, $textColumnTypes) { |
|
94 | 93 | foreach ((array) $config['searchable_attributes'] as $k => $searchColumn) { |
95 | 94 | $operation = ($k == 0) ? 'where' : 'orWhere'; |
96 | 95 | $columnType = $model_instance->getColumnType($searchColumn); |
@@ -122,7 +121,6 @@ discard block |
||
122 | 121 | |
123 | 122 | // return the results with or without pagination |
124 | 123 | return ($config['paginate'] !== false) ? |
125 | - $config['query']->paginate($config['paginate']) : |
|
126 | - $config['query']->get(); |
|
124 | + $config['query']->paginate($config['paginate']) : $config['query']->get(); |
|
127 | 125 | } |
128 | 126 | } |