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