We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | 'delete_confirmation_not_deleted_title' => 'Não apagado', |
| 66 | 66 | 'delete_confirmation_not_deleted_message' => 'Está tudo bem!. O item não foi apagado.', |
| 67 | 67 | |
| 68 | - // DataTables translation |
|
| 68 | + // DataTables translation |
|
| 69 | 69 | 'emptyTable' => 'Sem dados disponíveis na tabela', |
| 70 | 70 | 'info' => 'A mostrar _START_ a _END_ de _TOTAL_ registos', |
| 71 | 71 | 'infoEmpty' => 'A mostrar 0 a 0 de 0 registos', |
@@ -25,23 +25,23 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | // if this is a relation type field and no corresponding model was specified, get it from the relation method |
| 27 | 27 | // defined in the main model |
| 28 | - if (isset($complete_field_array['entity']) && ! isset($complete_field_array['model'])) { |
|
| 28 | + if (isset($complete_field_array['entity']) && !isset($complete_field_array['model'])) { |
|
| 29 | 29 | $complete_field_array['model'] = $this->getRelationModel($complete_field_array['entity']); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | // if the label is missing, we should set it |
| 33 | - if (! isset($complete_field_array['label'])) { |
|
| 33 | + if (!isset($complete_field_array['label'])) { |
|
| 34 | 34 | $complete_field_array['label'] = ucfirst($complete_field_array['name']); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | // if the field type is missing, we should set it |
| 38 | - if (! isset($complete_field_array['type'])) { |
|
| 38 | + if (!isset($complete_field_array['type'])) { |
|
| 39 | 39 | $complete_field_array['type'] = $this->getFieldTypeFromDbColumnType($complete_field_array['name']); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | // if a tab was mentioned, we should enable it |
| 43 | 43 | if (isset($complete_field_array['tab'])) { |
| 44 | - if (! $this->tabsEnabled()) { |
|
| 44 | + if (!$this->tabsEnabled()) { |
|
| 45 | 45 | $this->enableTabs(); |
| 46 | 46 | } |
| 47 | 47 | } |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | public function removeFields($array_of_names, $form = 'both') |
| 156 | 156 | { |
| 157 | - if (! empty($array_of_names)) { |
|
| 157 | + if (!empty($array_of_names)) { |
|
| 158 | 158 | foreach ($array_of_names as $name) { |
| 159 | 159 | $this->removeField($name, $form); |
| 160 | 160 | } |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | $jsonCastables = ['array', 'object', 'json']; |
| 219 | 219 | $fieldCasting = $casted_attributes[$field['name']]; |
| 220 | 220 | |
| 221 | - if (in_array($fieldCasting, $jsonCastables) && isset($data[$field['name']]) && ! empty($data[$field['name']]) && ! is_array($data[$field['name']])) { |
|
| 221 | + if (in_array($fieldCasting, $jsonCastables) && isset($data[$field['name']]) && !empty($data[$field['name']]) && !is_array($data[$field['name']])) { |
|
| 222 | 222 | try { |
| 223 | 223 | $data[$field['name']] = json_decode($data[$field['name']]); |
| 224 | 224 | } catch (Exception $e) { |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | // create an array with the names of the searchable columns |
| 16 | 16 | $columns = collect($this->crud->columns) |
| 17 | - ->reject(function ($column, $key) { |
|
| 17 | + ->reject(function($column, $key) { |
|
| 18 | 18 | // the select_multiple, model_function and model_function_attribute columns are not searchable |
| 19 | 19 | return isset($column['type']) && ($column['type'] == 'select_multiple' || $column['type'] == 'model_function' || $column['type'] == 'model_function_attribute'); |
| 20 | 20 | }) |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $dataTable = new \LiveControl\EloquentDataTable\DataTable($this->crud->query, $columns); |
| 30 | 30 | |
| 31 | 31 | // make the datatable use the column types instead of just echoing the text |
| 32 | - $dataTable->setFormatRowFunction(function ($entry) { |
|
| 32 | + $dataTable->setFormatRowFunction(function($entry) { |
|
| 33 | 33 | // get the actual HTML for each row's cell |
| 34 | 34 | $row_items = $this->crud->getRowViews($entry, $this->crud); |
| 35 | 35 | |
@@ -24,19 +24,19 @@ |
||
| 24 | 24 | if (isset($field['fake']) && $field['fake'] == true) { |
| 25 | 25 | // add it to the request in its appropriate variable - the one defined, if defined |
| 26 | 26 | if (isset($field['store_in'])) { |
| 27 | - if (! in_array($field['store_in'], $fakeFieldsColumnsArray, true)) { |
|
| 27 | + if (!in_array($field['store_in'], $fakeFieldsColumnsArray, true)) { |
|
| 28 | 28 | array_push($fakeFieldsColumnsArray, $field['store_in']); |
| 29 | 29 | } |
| 30 | 30 | } else { |
| 31 | 31 | //otherwise in the one defined in the $crud variable |
| 32 | - if (! in_array('extras', $fakeFieldsColumnsArray, true)) { |
|
| 32 | + if (!in_array('extras', $fakeFieldsColumnsArray, true)) { |
|
| 33 | 33 | array_push($fakeFieldsColumnsArray, 'extras'); |
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - if (! count($fakeFieldsColumnsArray)) { |
|
| 39 | + if (!count($fakeFieldsColumnsArray)) { |
|
| 40 | 40 | $fakeFieldsColumnsArray = ['extras']; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $fakeFieldKey = isset($field['store_in']) ? $field['store_in'] : 'extras'; |
| 30 | 30 | $this->addCompactedField($requestInput, $field['name'], $fakeFieldKey); |
| 31 | 31 | |
| 32 | - if (! in_array($fakeFieldKey, $compactedFakeFields)) { |
|
| 32 | + if (!in_array($fakeFieldKey, $compactedFakeFields)) { |
|
| 33 | 33 | $compactedFakeFields[] = $fakeFieldKey; |
| 34 | 34 | } |
| 35 | 35 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | // json_encode all fake_value columns in the database, so they can be properly stored and interpreted |
| 39 | 39 | foreach ($compactedFakeFields as $value) { |
| 40 | - if (! (property_exists($this->model, 'translatable') && in_array($value, $this->model->getTranslatableAttributes(), true))) { |
|
| 40 | + if (!(property_exists($this->model, 'translatable') && in_array($value, $this->model->getTranslatableAttributes(), true))) { |
|
| 41 | 41 | $requestInput[$value] = json_encode($requestInput[$value]); |
| 42 | 42 | } |
| 43 | 43 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function hasAccess($permission) |
| 35 | 35 | { |
| 36 | - if (! in_array($permission, $this->access)) { |
|
| 36 | + if (!in_array($permission, $this->access)) { |
|
| 37 | 37 | return false; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | public function hasAccessToAll($permission_array) |
| 69 | 69 | { |
| 70 | 70 | foreach ($permission_array as $key => $permission) { |
| 71 | - if (! in_array($permission, $this->access)) { |
|
| 71 | + if (!in_array($permission, $this->access)) { |
|
| 72 | 72 | return false; |
| 73 | 73 | } |
| 74 | 74 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | public function hasAccessOrFail($permission) |
| 88 | 88 | { |
| 89 | - if (! in_array($permission, $this->access)) { |
|
| 89 | + if (!in_array($permission, $this->access)) { |
|
| 90 | 90 | throw new AccessDeniedException(trans('backpack::crud.unauthorized_access')); |
| 91 | 91 | } |
| 92 | 92 | |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | * |
| 16 | 16 | * @param int $id The id of the item to be deleted. |
| 17 | 17 | * |
| 18 | - * @return bool True if the item was deleted. |
|
| 18 | + * @return string True if the item was deleted. |
|
| 19 | 19 | * |
| 20 | 20 | * @throws \Illuminate\Database\Eloquent\ModelNotFoundException if the model was not found. |
| 21 | 21 | * |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | public function addColumn($column) |
| 55 | 55 | { |
| 56 | 56 | // if a string was passed, not an array, change it to an array |
| 57 | - if (! is_array($column)) { |
|
| 57 | + if (!is_array($column)) { |
|
| 58 | 58 | $column = ['name' => $column]; |
| 59 | 59 | } |
| 60 | 60 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $column_with_details = $this->addDefaultLabel($column); |
| 63 | 63 | |
| 64 | 64 | // make sure the column has a name |
| 65 | - if (! array_key_exists('name', $column_with_details)) { |
|
| 65 | + if (!array_key_exists('name', $column_with_details)) { |
|
| 66 | 66 | $column_with_details['name'] = 'anonymous_column_'.str_random(5); |
| 67 | 67 | } |
| 68 | 68 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | // if this is a relation type field and no corresponding model was specified, get it from the relation method |
| 72 | 72 | // defined in the main model |
| 73 | - if (isset($column_with_details['entity']) && ! isset($column_with_details['model'])) { |
|
| 73 | + if (isset($column_with_details['entity']) && !isset($column_with_details['model'])) { |
|
| 74 | 74 | $column_with_details['model'] = $this->getRelationModel($column_with_details['entity']); |
| 75 | 75 | } |
| 76 | 76 | |
@@ -124,8 +124,7 @@ discard block |
||
| 124 | 124 | $targetColumnName = is_array($targetColumn) ? $targetColumn['name'] : $targetColumn; |
| 125 | 125 | |
| 126 | 126 | if (array_key_exists($targetColumnName, $this->columns)) { |
| 127 | - $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($this->columns)) : |
|
| 128 | - array_search($targetColumnName, array_keys($this->columns)) + 1; |
|
| 127 | + $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($this->columns)) : array_search($targetColumnName, array_keys($this->columns)) + 1; |
|
| 129 | 128 | |
| 130 | 129 | $element = array_pop($this->columns); |
| 131 | 130 | $beginningPart = array_slice($this->columns, 0, $targetColumnPosition, true); |
@@ -159,7 +158,7 @@ discard block |
||
| 159 | 158 | */ |
| 160 | 159 | public function addDefaultLabel($array) |
| 161 | 160 | { |
| 162 | - if (! array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) { |
|
| 161 | + if (!array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) { |
|
| 163 | 162 | $array = array_merge(['label' => ucfirst($this->makeLabel($array['name']))], $array); |
| 164 | 163 | |
| 165 | 164 | return $array; |
@@ -185,7 +184,7 @@ discard block |
||
| 185 | 184 | */ |
| 186 | 185 | public function removeColumns($columns) |
| 187 | 186 | { |
| 188 | - if (! empty($columns)) { |
|
| 187 | + if (!empty($columns)) { |
|
| 189 | 188 | foreach ($columns as $columnName) { |
| 190 | 189 | $this->removeColumn($columnName); |
| 191 | 190 | } |
@@ -206,8 +205,8 @@ discard block |
||
| 206 | 205 | */ |
| 207 | 206 | public function remove($entity, $fields) |
| 208 | 207 | { |
| 209 | - return array_values(array_filter($this->{$entity}, function ($field) use ($fields) { |
|
| 210 | - return ! in_array($field['name'], (array) $fields); |
|
| 208 | + return array_values(array_filter($this->{$entity}, function($field) use ($fields) { |
|
| 209 | + return !in_array($field['name'], (array) $fields); |
|
| 211 | 210 | })); |
| 212 | 211 | } |
| 213 | 212 | |
@@ -258,7 +257,7 @@ discard block |
||
| 258 | 257 | { |
| 259 | 258 | $columns = $this->getColumns(); |
| 260 | 259 | |
| 261 | - return collect($columns)->pluck('entity')->reject(function ($value, $key) { |
|
| 260 | + return collect($columns)->pluck('entity')->reject(function($value, $key) { |
|
| 262 | 261 | return $value == null; |
| 263 | 262 | })->toArray(); |
| 264 | 263 | } |