We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | * |
| 70 | 70 | * @param array $columns - the database columns that contain the JSONs |
| 71 | 71 | * |
| 72 | - * @return Model |
|
| 72 | + * @return CrudTrait |
|
| 73 | 73 | */ |
| 74 | 74 | public function withFakes($columns = []) |
| 75 | 75 | { |
@@ -3,9 +3,9 @@ |
||
| 3 | 3 | namespace Backpack\CRUD; |
| 4 | 4 | |
| 5 | 5 | use DB; |
| 6 | -use Traversable; |
|
| 7 | -use Illuminate\Support\Facades\Config; |
|
| 8 | 6 | use Illuminate\Database\Eloquent\Model; |
| 7 | +use Illuminate\Support\Facades\Config; |
|
| 8 | +use Traversable; |
|
| 9 | 9 | |
| 10 | 10 | trait CrudTrait |
| 11 | 11 | { |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $conn->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('json', 'json_array'); |
| 60 | 60 | $conn->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('jsonb', 'json_array'); |
| 61 | 61 | |
| 62 | - return ! $conn->getDoctrineColumn($table, $column_name)->getNotnull(); |
|
| 62 | + return !$conn->getDoctrineColumn($table, $column_name)->getNotnull(); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /* |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | public function addFakes($columns = ['extras']) |
| 77 | 77 | { |
| 78 | 78 | foreach ($columns as $key => $column) { |
| 79 | - if (! isset($this->attributes[$column])) { |
|
| 79 | + if (!isset($this->attributes[$column])) { |
|
| 80 | 80 | continue; |
| 81 | 81 | } |
| 82 | 82 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | { |
| 106 | 106 | $model = '\\'.get_class($this); |
| 107 | 107 | |
| 108 | - if (! count($columns)) { |
|
| 108 | + if (!count($columns)) { |
|
| 109 | 109 | $columns = (property_exists($model, 'fakeColumns')) ? $this->fakeColumns : ['extras']; |
| 110 | 110 | } |
| 111 | 111 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | public function shouldDecodeFake($column) |
| 124 | 124 | { |
| 125 | - return ! in_array($column, array_keys($this->casts)); |
|
| 125 | + return !in_array($column, array_keys($this->casts)); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public function shouldEncodeFake($column) |
| 135 | 135 | { |
| 136 | - return ! in_array($column, array_keys($this->casts)); |
|
| 136 | + return !in_array($column, array_keys($this->casts)); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /* |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $attribute_value = (array) $this->{$attribute_name}; |
| 217 | 217 | foreach ($files_to_clear as $key => $filename) { |
| 218 | 218 | \Storage::disk($disk)->delete($filename); |
| 219 | - $attribute_value = array_where($attribute_value, function ($value, $key) use ($filename) { |
|
| 219 | + $attribute_value = array_where($attribute_value, function($value, $key) use ($filename) { |
|
| 220 | 220 | return $value != $filename; |
| 221 | 221 | }); |
| 222 | 222 | } |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | <!-- Include jQuery, jQuery UI, elFinder (REQUIRED) --> |
| 27 | 27 | |
| 28 | 28 | <?php |
| 29 | - $mimeTypes = implode(',', array_map(function ($t) { |
|
| 29 | + $mimeTypes = implode(',', array_map(function($t) { |
|
| 30 | 30 | return "'".$t."'"; |
| 31 | 31 | }, explode(',', $type))); |
| 32 | 32 | ?> |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | $revisionDate = date('Y-m-d', strtotime((string) $history->created_at)); |
| 22 | 22 | |
| 23 | 23 | // Be sure to instantiate the initial grouping array |
| 24 | - if (! array_key_exists($revisionDate, $revisions)) { |
|
| 24 | + if (!array_key_exists($revisionDate, $revisions)) { |
|
| 25 | 25 | $revisions[$revisionDate] = []; |
| 26 | 26 | } |
| 27 | 27 | |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <!-- text input --> |
| 2 | 2 | <?php |
| 3 | 3 | |
| 4 | -$value = old($field['name']) ? (old($field['name'])) : (isset($field['value']) ? ($field['value']) : (isset($field['default']) ? ($field['default']) : '' )); |
|
| 4 | +$value = old($field['name']) ? (old($field['name'])) : (isset($field['value']) ? ($field['value']) : (isset($field['default']) ? ($field['default']) : '')); |
|
| 5 | 5 | |
| 6 | 6 | // if attribute casting is used, convert to JSON |
| 7 | 7 | if (is_array($value)) { |
| 8 | - $value = json_encode((object)$value); |
|
| 8 | + $value = json_encode((object) $value); |
|
| 9 | 9 | } elseif (is_object($value)) { |
| 10 | 10 | $value = json_encode($value); |
| 11 | 11 | } else { |
@@ -124,7 +124,7 @@ |
||
| 124 | 124 | |
| 125 | 125 | /** |
| 126 | 126 | * Determine if the current CRUD action is a list operation (using standard or ajax DataTables). |
| 127 | - * @return bool |
|
| 127 | + * @return boolean|null |
|
| 128 | 128 | */ |
| 129 | 129 | public function doingListOperation() |
| 130 | 130 | { |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | public function filtersEnabled() |
| 13 | 13 | { |
| 14 | - return ! is_array($this->filters); |
|
| 14 | + return !is_array($this->filters); |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | /** |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $this->enableFilters(); |
| 60 | 60 | |
| 61 | 61 | // check if another filter with the same name exists |
| 62 | - if (! isset($options['name'])) { |
|
| 62 | + if (!isset($options['name'])) { |
|
| 63 | 63 | abort(500, 'All your filters need names.'); |
| 64 | 64 | } |
| 65 | 65 | if ($this->filters->contains('name', $options['name'])) { |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | { |
| 161 | 161 | $filter = $this->filters->firstWhere('name', $name); |
| 162 | 162 | |
| 163 | - if (! $filter) { |
|
| 163 | + if (!$filter) { |
|
| 164 | 164 | abort(500, 'CRUD Filter "'.$name.'" not found. Please check the filter exists before you modify it.'); |
| 165 | 165 | } |
| 166 | 166 | |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | |
| 176 | 176 | public function removeFilter($name) |
| 177 | 177 | { |
| 178 | - $this->filters = $this->filters->reject(function ($filter) use ($name) { |
|
| 178 | + $this->filters = $this->filters->reject(function($filter) use ($name) { |
|
| 179 | 179 | return $filter->name == $name; |
| 180 | 180 | }); |
| 181 | 181 | } |
@@ -259,16 +259,16 @@ discard block |
||
| 259 | 259 | |
| 260 | 260 | public function checkOptionsIntegrity($options) |
| 261 | 261 | { |
| 262 | - if (! isset($options['name'])) { |
|
| 262 | + if (!isset($options['name'])) { |
|
| 263 | 263 | abort(500, 'Please make sure all your filters have names.'); |
| 264 | 264 | } |
| 265 | - if (! isset($options['type'])) { |
|
| 265 | + if (!isset($options['type'])) { |
|
| 266 | 266 | abort(500, 'Please make sure all your filters have types.'); |
| 267 | 267 | } |
| 268 | - if (! \View::exists('crud::filters.'.$options['type'])) { |
|
| 268 | + if (!\View::exists('crud::filters.'.$options['type'])) { |
|
| 269 | 269 | abort(500, 'No filter view named "'.$options['type'].'.blade.php" was found.'); |
| 270 | 270 | } |
| 271 | - if (! isset($options['label'])) { |
|
| 271 | + if (!isset($options['label'])) { |
|
| 272 | 272 | abort(500, 'Please make sure all your filters have labels.'); |
| 273 | 273 | } |
| 274 | 274 | } |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | <?php |
| 4 | 4 | // if the column has been cast to Carbon or Date (using attribute casting) |
| 5 | 5 | // get the value as a date string |
| 6 | -if (isset($field['value']) && ( $field['value'] instanceof \Carbon\Carbon || $field['value'] instanceof \Jenssegers\Date\Date )) { |
|
| 6 | +if (isset($field['value']) && ($field['value'] instanceof \Carbon\Carbon || $field['value'] instanceof \Jenssegers\Date\Date)) { |
|
| 7 | 7 | $field['value'] = $field['value']->toDateString(); |
| 8 | 8 | } |
| 9 | 9 | ?> |
@@ -3,11 +3,11 @@ |
||
| 3 | 3 | <?php |
| 4 | 4 | // if the column has been cast to Carbon or Date (using attribute casting) |
| 5 | 5 | // get the value as a date string |
| 6 | -if (isset($field['value']) && ( $field['value'] instanceof \Carbon\Carbon || $field['value'] instanceof \Jenssegers\Date\Date )) { |
|
| 6 | +if (isset($field['value']) && ($field['value'] instanceof \Carbon\Carbon || $field['value'] instanceof \Jenssegers\Date\Date)) { |
|
| 7 | 7 | $field['value'] = $field['value']->format('Y-m-d H:i:s'); |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | - $field_language = isset($field['datetime_picker_options']['language'])?$field['datetime_picker_options']['language']:\App::getLocale(); |
|
| 10 | + $field_language = isset($field['datetime_picker_options']['language']) ? $field['datetime_picker_options']['language'] : \App::getLocale(); |
|
| 11 | 11 | ?> |
| 12 | 12 | |
| 13 | 13 | <div @include('crud::inc.field_wrapper_attributes') > |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | <?php |
| 4 | 4 | // if the column has been cast to Carbon or Date (using attribute casting) |
| 5 | 5 | // get the value as a date string |
| 6 | -if (isset($field['value']) && ( $field['value'] instanceof \Carbon\Carbon || $field['value'] instanceof \Jenssegers\Date\Date )) { |
|
| 6 | +if (isset($field['value']) && ($field['value'] instanceof \Carbon\Carbon || $field['value'] instanceof \Jenssegers\Date\Date)) { |
|
| 7 | 7 | $field['value'] = $field['value']->toDateTimeString(); |
| 8 | 8 | } |
| 9 | 9 | ?> |
@@ -3,11 +3,11 @@ |
||
| 3 | 3 | <?php |
| 4 | 4 | // if the column has been cast to Carbon or Date (using attribute casting) |
| 5 | 5 | // get the value as a date string |
| 6 | - if (isset($field['value']) && ( $field['value'] instanceof \Carbon\Carbon || $field['value'] instanceof \Jenssegers\Date\Date )) { |
|
| 6 | + if (isset($field['value']) && ($field['value'] instanceof \Carbon\Carbon || $field['value'] instanceof \Jenssegers\Date\Date)) { |
|
| 7 | 7 | $field['value'] = $field['value']->format('Y-m-d'); |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | - $field_language = isset($field['date_picker_options']['language'])?$field['date_picker_options']['language']:\App::getLocale(); |
|
| 10 | + $field_language = isset($field['date_picker_options']['language']) ? $field['date_picker_options']['language'] : \App::getLocale(); |
|
| 11 | 11 | ?> |
| 12 | 12 | |
| 13 | 13 | <div @include('crud::inc.field_wrapper_attributes') > |