Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-to authored and actions-user committed May 23, 2023
1 parent 9160058 commit 2825193
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/Fields/FormElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ final public function __construct(
if ($this->hasRelationship()) {
$this->setField($field ?? (string)str($this->label)->camel());

if ($this->belongToOne() && !str($this->field())->contains('_id')) {
if ($this->belongToOne() && ! str($this->field())->contains('_id')) {
$this->setField(
(string)str($this->field())
->append('_id')
Expand Down Expand Up @@ -156,7 +156,7 @@ protected function findResource(): ?ResourceContract
return $this->resource;
}

if (!$this->relation()) {
if (! $this->relation()) {
return null;
}

Expand Down Expand Up @@ -341,11 +341,11 @@ public function requestValue(string|int|null $index = null): mixed
$nameDot = str($this->isXModelField() ? $this->field() : $this->nameDot())
->when(
$this->parentRequestValueKey(),
fn(Stringable $str) => $str->prepend("{$this->parentRequestValueKey()}.")
fn (Stringable $str) => $str->prepend("{$this->parentRequestValueKey()}.")
)
->when(
!is_null($index) && $index !== '',
fn(Stringable $str) => $str->append(".$index")
! is_null($index) && $index !== '',
fn (Stringable $str) => $str->append(".$index")
)->value();

$default = $this instanceof HasDefaultValue
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/Fields/FileTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function hiddenOldValuesKey(): string
return str('hidden_')
->when(
$this->parentRequestValueKey(),
fn(Stringable $str) => $str->append(
fn (Stringable $str) => $str->append(
$this->parentRequestValueKey() . "."
)
)
Expand Down Expand Up @@ -153,7 +153,7 @@ public function hasManyOrOneSave(array|UploadedFile|null $valueOrValues = null):
{
if ($this->isMultiple()) {
throw_if(
!is_null($valueOrValues) && !is_array($valueOrValues),
! is_null($valueOrValues) && ! is_array($valueOrValues),
new FieldException('Files must be an array')
);

Expand Down
2 changes: 1 addition & 1 deletion src/Traits/Fields/HasOneOrMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function save(Model $item): Model
: $item->{$this->relation()};

foreach ($items as $newItem) {
$fields->each(static fn(FormElement $field) => $field->afterSave($newItem));
$fields->each(static fn (FormElement $field) => $field->afterSave($newItem));
}
}
} elseif ($this instanceof HasOne) {
Expand Down

0 comments on commit 2825193

Please sign in to comment.