We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | <!-- elFinder JS (REQUIRED) --> |
| 18 | 18 | <script src="<?= asset($dir.'/js/elfinder.min.js') ?>"></script> |
| 19 | 19 | |
| 20 | - <?php if($locale){ ?> |
|
| 20 | + <?php if ($locale) { ?> |
|
| 21 | 21 | <!-- elFinder translation (OPTIONAL) --> |
| 22 | 22 | <script src="<?= asset($dir."/js/i18n/elfinder.$locale.js") ?>"></script> |
| 23 | 23 | <?php } ?> |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $().ready(function() { |
| 41 | 41 | var elf = $('#elfinder').elfinder({ |
| 42 | 42 | // set your elFinder options here |
| 43 | - <?php if($locale){ ?> |
|
| 43 | + <?php if ($locale) { ?> |
|
| 44 | 44 | lang: '<?= $locale ?>', // locale |
| 45 | 45 | <?php } ?> |
| 46 | 46 | customData: { |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | <!-- elFinder JS (REQUIRED) --> |
| 18 | 18 | <script src="<?= asset($dir.'/js/elfinder.min.js') ?>"></script> |
| 19 | 19 | |
| 20 | - <?php if($locale){ ?> |
|
| 20 | + <?php if ($locale) { ?> |
|
| 21 | 21 | <!-- elFinder translation (OPTIONAL) --> |
| 22 | 22 | <script src="<?= asset($dir."/js/i18n/elfinder.$locale.js") ?>"></script> |
| 23 | 23 | <?php } ?> |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $().ready(function() { |
| 41 | 41 | var elf = $('#elfinder').elfinder({ |
| 42 | 42 | // set your elFinder options here |
| 43 | - <?php if($locale){ ?> |
|
| 43 | + <?php if ($locale) { ?> |
|
| 44 | 44 | lang: '<?= $locale ?>', // locale |
| 45 | 45 | <?php } ?> |
| 46 | 46 | customData: { |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | <!-- elFinder JS (REQUIRED) --> |
| 18 | 18 | <script src="<?= asset($dir.'/js/elfinder.min.js') ?>"></script> |
| 19 | 19 | |
| 20 | - <?php if($locale){ ?> |
|
| 20 | + <?php if ($locale) { ?> |
|
| 21 | 21 | <!-- elFinder translation (OPTIONAL) --> |
| 22 | 22 | <script src="<?= asset($dir."/js/i18n/elfinder.$locale.js") ?>"></script> |
| 23 | 23 | <?php } ?> |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $().ready(function() { |
| 41 | 41 | var elf = $('#elfinder').elfinder({ |
| 42 | 42 | // set your elFinder options here |
| 43 | - <?php if($locale){ ?> |
|
| 43 | + <?php if ($locale) { ?> |
|
| 44 | 44 | lang: '<?= $locale ?>', // locale |
| 45 | 45 | <?php } ?> |
| 46 | 46 | customData: { |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | <!-- elFinder JS (REQUIRED) --> |
| 18 | 18 | <script src="<?= asset($dir.'/js/elfinder.min.js') ?>"></script> |
| 19 | 19 | |
| 20 | - <?php if($locale){ ?> |
|
| 20 | + <?php if ($locale) { ?> |
|
| 21 | 21 | <!-- elFinder translation (OPTIONAL) --> |
| 22 | 22 | <script src="<?= asset($dir."/js/i18n/elfinder.$locale.js") ?>"></script> |
| 23 | 23 | <?php } ?> |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $().ready(function() { |
| 41 | 41 | var elf = $('#elfinder').elfinder({ |
| 42 | 42 | // set your elFinder options here |
| 43 | - <?php if($locale){ ?> |
|
| 43 | + <?php if ($locale) { ?> |
|
| 44 | 44 | lang: '<?= $locale ?>', // locale |
| 45 | 45 | <?php } ?> |
| 46 | 46 | customData: { |
@@ -12,14 +12,14 @@ |
||
| 12 | 12 | |-------------------------------------------------------------------------- |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | - public static function getPossibleEnumValues($field_name){ |
|
| 15 | + public static function getPossibleEnumValues($field_name) { |
|
| 16 | 16 | $instance = new static; // create an instance of the model to be able to get the table name |
| 17 | - $type = DB::select( DB::raw('SHOW COLUMNS FROM '.$instance->getTable().' WHERE Field = "'.$field_name.'"') )[0]->Type; |
|
| 17 | + $type = DB::select(DB::raw('SHOW COLUMNS FROM '.$instance->getTable().' WHERE Field = "'.$field_name.'"'))[0]->Type; |
|
| 18 | 18 | preg_match('/^enum\((.*)\)$/', $type, $matches); |
| 19 | 19 | $enum = array(); |
| 20 | 20 | $exploded = explode(',', $matches[1]); |
| 21 | - foreach($exploded as $value){ |
|
| 22 | - $v = trim( $value, "'" ); |
|
| 21 | + foreach ($exploded as $value) { |
|
| 22 | + $v = trim($value, "'"); |
|
| 23 | 23 | $enum[] = $v; |
| 24 | 24 | } |
| 25 | 25 | return $enum; |
@@ -157,7 +157,7 @@ |
||
| 157 | 157 | 'model' => "App\Models\Example" |
| 158 | 158 | ], |
| 159 | 159 | ]; |
| 160 | - $this->crud->fields = [ |
|
| 160 | + $this->crud->fields = [ |
|
| 161 | 161 | [ |
| 162 | 162 | 'name' => 'name', |
| 163 | 163 | 'label' => "Example item text" |
@@ -15,15 +15,15 @@ discard block |
||
| 15 | 15 | $dependencyArray = []; |
| 16 | 16 | |
| 17 | 17 | //convert dependency array to simple matrix ( prymary id as key and array with secondaries id ) |
| 18 | - foreach($dependencies as $primary){ |
|
| 18 | + foreach ($dependencies as $primary) { |
|
| 19 | 19 | $dependencyArray[$primary->id] = []; |
| 20 | - foreach($primary->{$primary_dependency['entity_secondary']} as $secondary){ |
|
| 20 | + foreach ($primary->{$primary_dependency['entity_secondary']} as $secondary) { |
|
| 21 | 21 | $dependencyArray[$primary->id][] = $secondary->id; |
| 22 | 22 | } |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | //for update form, get initial state of the entity |
| 26 | - if( isset($id) && $id ){ |
|
| 26 | + if (isset($id) && $id) { |
|
| 27 | 27 | |
| 28 | 28 | //get entity with relations for primary dependency |
| 29 | 29 | $entity_dependencies = $entity_model->with($primary_dependency['entity']) |
@@ -39,15 +39,15 @@ discard block |
||
| 39 | 39 | $secondary_ids = []; |
| 40 | 40 | |
| 41 | 41 | //create secondary dependency from primary relation, used to check what chekbox must be check from second checklist |
| 42 | - if( old($primary_dependency['name']) ) { |
|
| 43 | - foreach( old($primary_dependency['name']) as $primary_item ){ |
|
| 44 | - foreach($dependencyArray[$primary_item] as $second_item ){ |
|
| 42 | + if (old($primary_dependency['name'])) { |
|
| 43 | + foreach (old($primary_dependency['name']) as $primary_item) { |
|
| 44 | + foreach ($dependencyArray[$primary_item] as $second_item) { |
|
| 45 | 45 | $secondary_ids[$second_item] = $second_item; |
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | - }else{ //create dependecies from relation if not from validate error |
|
| 49 | - foreach( $primary_array as $primary_item ){ |
|
| 50 | - foreach($primary_item[$secondary_dependency['entity']] as $second_item ){ |
|
| 48 | + } else { //create dependecies from relation if not from validate error |
|
| 49 | + foreach ($primary_array as $primary_item) { |
|
| 50 | + foreach ($primary_item[$secondary_dependency['entity']] as $second_item) { |
|
| 51 | 51 | $secondary_ids[$second_item['id']] = $second_item['id']; |
| 52 | 52 | } |
| 53 | 53 | } |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <!-- select2 --> |
| 2 | 2 | <div class="form-group"> |
| 3 | 3 | <label>{{ $field['label'] }}</label> |
| 4 | - <?php $entity_model = $crud->getModel();?> |
|
| 4 | + <?php $entity_model = $crud->getModel(); ?> |
|
| 5 | 5 | |
| 6 | 6 | <div class="row"> |
| 7 | 7 | @foreach ($field['model']::all() as $connected_entity_entry) |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | public function removePermissions($permissions) // DONE |
| 127 | 127 | { |
| 128 | - $this->removeButtons((array)$permissions); |
|
| 128 | + $this->removeButtons((array) $permissions); |
|
| 129 | 129 | |
| 130 | - return $this->permissions = array_diff($this->permissions, (array)$permissions); |
|
| 130 | + return $this->permissions = array_diff($this->permissions, (array) $permissions); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | public function setColumns($columns) |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | |
| 159 | 159 | public function orderColumns($order) |
| 160 | 160 | { |
| 161 | - $this->setSort('columns', (array)$order); |
|
| 161 | + $this->setSort('columns', (array) $order); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | public function setFields($fields) |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | |
| 229 | 229 | public function orderFields($order) |
| 230 | 230 | { |
| 231 | - $this->setSort('fields', (array)$order); |
|
| 231 | + $this->setSort('fields', (array) $order); |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | public function items() |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | |
| 288 | 288 | public function unsetListActions($actions) |
| 289 | 289 | { |
| 290 | - return $this->listActions = array_diff($this->listActions, (array)$actions); |
|
| 290 | + return $this->listActions = array_diff($this->listActions, (array) $actions); |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | public function checkListAction($action) |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | |
| 313 | 313 | public function setRequired($fields) |
| 314 | 314 | { |
| 315 | - $this->required = array_merge($this->required, (array)$fields); |
|
| 315 | + $this->required = array_merge($this->required, (array) $fields); |
|
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | public function required() |
@@ -380,14 +380,14 @@ discard block |
||
| 380 | 380 | |
| 381 | 381 | private function syncColumn($column) |
| 382 | 382 | { |
| 383 | - if (array_key_exists('name', (array)$column)) return array_merge(['type' => $this->getType($column['name'])], $column); |
|
| 383 | + if (array_key_exists('name', (array) $column)) return array_merge(['type' => $this->getType($column['name'])], $column); |
|
| 384 | 384 | |
| 385 | 385 | return false; |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | private function syncField($field) |
| 389 | 389 | { |
| 390 | - if (array_key_exists('name', (array)$field)) return array_merge(['type' => $this->getType($field['name']), 'value' => '', 'default' => null, 'values' => [], 'attributes' => []], $field); |
|
| 390 | + if (array_key_exists('name', (array) $field)) return array_merge(['type' => $this->getType($field['name']), 'value' => '', 'default' => null, 'values' => [], 'attributes' => []], $field); |
|
| 391 | 391 | |
| 392 | 392 | return false; |
| 393 | 393 | } |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | if (!empty($this->{$type})) |
| 500 | 500 | { |
| 501 | 501 | $this->{$type} = array_map(function($field) use ($fields, $attributes) { |
| 502 | - if (in_array($field['name'], (array)$fields)) $field = array_merge($field, $attributes); |
|
| 502 | + if (in_array($field['name'], (array) $fields)) $field = array_merge($field, $attributes); |
|
| 503 | 503 | |
| 504 | 504 | return $field; |
| 505 | 505 | }, $this->{$type}); |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | |
| 509 | 509 | private function remove($entity, $fields) |
| 510 | 510 | { |
| 511 | - return array_values(array_filter($this->{$entity}, function($field) use ($fields) { return !in_array($field['name'], (array)$fields);})); |
|
| 511 | + return array_values(array_filter($this->{$entity}, function($field) use ($fields) { return !in_array($field['name'], (array) $fields); })); |
|
| 512 | 512 | } |
| 513 | 513 | |
| 514 | 514 | private function setSort($items, $order) |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | if (is_numeric($key = array_search($item, array_column($this->{$items}, 'name')))) $elements[] = $this->{$items}[$key]; |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | - return $this->{$items} = array_merge($elements, array_filter($this->{$items}, function($item) use($items) {return !in_array($item['name'], $this->sort[$items]);})); |
|
| 530 | + return $this->{$items} = array_merge($elements, array_filter($this->{$items}, function($item) use($items) {return !in_array($item['name'], $this->sort[$items]); })); |
|
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | return $this->{$items}; |
@@ -537,11 +537,11 @@ discard block |
||
| 537 | 537 | { |
| 538 | 538 | foreach ($this->relations as $key => $relation) |
| 539 | 539 | { |
| 540 | - if ($relation['pivot']){ |
|
| 540 | + if ($relation['pivot']) { |
|
| 541 | 541 | $model->{$relation['name']}()->sync($data[$key]); |
| 542 | 542 | |
| 543 | - foreach($relation['pivotFields'] as $pivotField){ |
|
| 544 | - foreach($data[$pivotField] as $pivot_id => $field){ |
|
| 543 | + foreach ($relation['pivotFields'] as $pivotField) { |
|
| 544 | + foreach ($data[$pivotField] as $pivot_id => $field) { |
|
| 545 | 545 | $model->{$relation['name']}()->updateExistingPivot($pivot_id, [$pivotField => $field]); |
| 546 | 546 | } |
| 547 | 547 | } |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | |
| 552 | 552 | private function getRelationValues($model, $field, $where = [], $order = []) |
| 553 | 553 | { |
| 554 | - $order = (array)$order; |
|
| 554 | + $order = (array) $order; |
|
| 555 | 555 | $values = $model->select('*'); |
| 556 | 556 | |
| 557 | 557 | if (!empty($where)) call_user_func_array([$values, $where[0]], array_slice($where, 1)); |