Skip to content

Commit 9c34be7

Browse files
committed
Apply fixes from StyleCI
[ci skip] [skip ci]
1 parent c9a375f commit 9c34be7

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

src/app/Library/CrudPanel/Traits/FieldsProtectedMethods.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,29 +296,29 @@ protected function makeSureSubfieldsHaveNecessaryAttributes($field)
296296
case 'MorphToMany':
297297
case 'BelongsToMany':
298298
$pivotSelectorField = static::getPivotFieldStructure($field);
299-
300-
$pivot = Arr::where($field['subfields'], function($item) use ($pivotSelectorField) {
299+
300+
$pivot = Arr::where($field['subfields'], function ($item) use ($pivotSelectorField) {
301301
return $item['name'] === $pivotSelectorField['name'];
302302
});
303303

304-
if(!empty($pivot)) {
304+
if (! empty($pivot)) {
305305
break;
306306
}
307307

308308
$this->setupFieldValidation($pivotSelectorField, $field['name']);
309309
$field['subfields'] = Arr::prepend($field['subfields'], $pivotSelectorField);
310-
310+
311311
break;
312312
case 'MorphMany':
313313
case 'HasMany':
314314
$entity = isset($field['baseEntity']) ? $field['baseEntity'].'.'.$field['entity'] : $field['entity'];
315315
$relationInstance = $this->getRelationInstance(['entity' => $entity]);
316316

317-
$localKeyField = Arr::where($field['subfields'], function($item) use ($relationInstance) {
317+
$localKeyField = Arr::where($field['subfields'], function ($item) use ($relationInstance) {
318318
return $item['name'] === $relationInstance->getRelated()->getKeyName();
319319
});
320-
321-
if(!empty($localKeyField)) {
320+
321+
if (! empty($localKeyField)) {
322322
break;
323323
}
324324

src/app/Library/Uploaders/Support/Traits/HandleRepeatableUploads.php

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ private function retrieveRepeatableRelationFiles(Model $entry)
119119
$entry->{$pivotFieldName} = $this->retrieveFiles($connectedEntry)->{$this->getName()};
120120

121121
break;
122-
default:
122+
default:
123123
$entry = $this->retrieveFiles($entry);
124124
}
125125

@@ -152,21 +152,19 @@ private function deleteRepeatableFiles(Model $entry): void
152152
switch($this->getRepeatableRelationType()) {
153153
case 'BelongsToMany':
154154
$pivotAttributes = $entry->getAttributes();
155-
$connectedPivot = $entry->pivotParent->{$this->getRepeatableContainerName()}->where(function($item) use ($pivotAttributes) {
156-
155+
$connectedPivot = $entry->pivotParent->{$this->getRepeatableContainerName()}->where(function ($item) use ($pivotAttributes) {
157156
$itemPivotAttributes = $item->pivot->only(array_keys($pivotAttributes));
158-
157+
159158
return $itemPivotAttributes === $pivotAttributes;
160-
161159
})->first();
162-
163-
if(!$connectedPivot) {
160+
161+
if (! $connectedPivot) {
164162
return;
165163
}
166164

167165
$files = $connectedPivot->getOriginal()['pivot_'.$this->getName()];
168-
169-
if(!$files) {
166+
167+
if (! $files) {
170168
return;
171169
}
172170

@@ -175,13 +173,13 @@ private function deleteRepeatableFiles(Model $entry): void
175173
$value = Str::start($value, $this->getPath());
176174
Storage::disk($this->getDisk())->delete($value);
177175
}
178-
176+
179177
return;
180178
}
181179

182180
$value = Str::start($files, $this->getPath());
183181
Storage::disk($this->getDisk())->delete($value);
184-
182+
185183
return;
186184
}
187185

0 commit comments

Comments
 (0)