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 github-actions[bot] committed Jul 19, 2024
1 parent bc3c799 commit 48a1881
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/Core/Handlers/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function modifyButton(Closure $closure): static

protected function prepareButton(ActionButtonContract $button): ActionButtonContract
{
if(!is_null($this->modifyButton)) {
if(! is_null($this->modifyButton)) {
return value($this->modifyButton, $button, $this);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Core/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function has(string $key): bool

public function getAll(): Collection
{
$body = $this->request->getParsedBody();
$body = $this->request->getParsedBody();
$files = $this->request->getUploadedFiles();
$query = $this->request->getQueryParams();

Expand Down
2 changes: 1 addition & 1 deletion src/UI/Traits/Fields/FileTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function remainingValuesResolver(Closure $closure): static

public function getRemainingValues(): Collection
{
if(!is_null($this->remainingValuesResolver)) {
if(! is_null($this->remainingValuesResolver)) {
return value($this->remainingValuesResolver, $this);
}

Expand Down
6 changes: 3 additions & 3 deletions src/UI/Traits/Fields/WithQuickFormElementAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected function prepareNameAttribute($index = null, $wrap = null): string
! is_null($wrap),
fn (Stringable $str): Stringable => $str->prepend("$wrap.")
)
->pipe(fn(Stringable $str) => $this->getDotNestedToName($str->value()))
->pipe(fn (Stringable $str) => $this->getDotNestedToName($str->value()))
->when(
$this->isGroup() || $this->getAttribute('multiple'),
fn (Stringable $str): Stringable => $str->append(
Expand All @@ -89,14 +89,14 @@ protected function prepareNameAttribute($index = null, $wrap = null): string
public function generateNameFrom(?string ...$values): string
{
return str('')
->pipe(static function(Stringable $str) use($values) {
->pipe(static function (Stringable $str) use ($values) {
foreach (collect($values)->filter() as $value) {
$str = $str->append(".$value");
}

return $str->trim('.');
})
->pipe(fn(Stringable $str) => $this->getDotNestedToName($str->value()))
->pipe(fn (Stringable $str) => $this->getDotNestedToName($str->value()))
->value();
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/Fields/JsonFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function testJsonValue(TestResource $resource, Item $item, array $data, ?array $
'data' => [
['title' => 'Title 1', 'value' => 'Value 1', 'file' => $file],
['title' => 'Title 2', 'value' => 'Value 2', 'file' => $file],
]
],
];

asAdmin()->put(
Expand Down Expand Up @@ -97,7 +97,7 @@ function testJsonValue(TestResource $resource, Item $item, array $data, ?array $
'data' => [
['title' => 'Title 1', 'value' => 'Value 1'],
['title' => 'Title 2', 'value' => 'Value 2', 'hidden_file' => $file->hashName()],
]
],
];

asAdmin()->put(
Expand Down
6 changes: 3 additions & 3 deletions tests/Feature/Fields/Relationships/BelongsToManyFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function testBelongsToManyValue(TestResource $resource, Item $item, array $data,
]])->sort()->toArray();
};

if(!is_null($pivotData)) {
if(! is_null($pivotData)) {
$data = $mapper($data, $pivotData);
}

Expand Down Expand Up @@ -128,7 +128,7 @@ function testBelongsToManyValue(TestResource $resource, Item $item, array $data,

testBelongsToManyValue($resource, $this->item, $data, pivotData: $pivotData);

$this->item->categories->each(function ($category) use($file) {
$this->item->categories->each(function ($category) use ($file) {
expect($category->pivot->pivot_1)
->toBe('test 1')
->and($category->pivot->pivot_2)
Expand Down Expand Up @@ -208,7 +208,7 @@ function testBelongsToManyValue(TestResource $resource, Item $item, array $data,

testBelongsToManyValue($resource, $this->item, $data, pivotData: $pivotData);

$this->item->categories->each(function ($category) use($file) {
$this->item->categories->each(function ($category) use ($file) {
expect($category->pivot->pivot_1)
->toBe('test 1')
->and($category->pivot->pivot_2)
Expand Down
16 changes: 8 additions & 8 deletions tests/Feature/Fields/TempateFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ function baseTemplateSaveFile(Item $item, ?UploadedFile $changedFile = null, ?ar
$resource = addFieldsToTestResource(
Template::make('Data')
->fields([
File::make('File')
File::make('File'),
])
->changeFill(fn(Item $data, Template $field) => data_get($data, $field->getColumn(), []))
->changeFill(fn (Item $data, Template $field) => data_get($data, $field->getColumn(), []))
->onApply(onApply: function (Item $item, $value, Template $field) {
$column = $field->getColumn();
$applyValues = [];

foreach ($field->getPreparedFields() as $f) {
$apply = $f->apply(
fn($data): mixed => data_set($data, $f->getColumn(), $value[$f->getColumn()] ?? ''),
fn ($data): mixed => data_set($data, $f->getColumn(), $value[$f->getColumn()] ?? ''),
$value
);

Expand Down Expand Up @@ -80,7 +80,7 @@ function baseTemplateIterableSaveFile(Item $item, ?UploadedFile $changedFile = n
->fields([
File::make('File'),
])
->changeFill(fn(Item $data, Template $field) => data_get($data, $field->getColumn(), []))
->changeFill(fn (Item $data, Template $field) => data_get($data, $field->getColumn(), []))
->onApply(onApply: function (Item $item, $values, Template $field) {
$column = $field->getColumn();
$applyValues = [];
Expand All @@ -90,7 +90,7 @@ function baseTemplateIterableSaveFile(Item $item, ?UploadedFile $changedFile = n
$f->setNameIndex($index);

$apply = $f->apply(
fn($data): mixed => data_set($data, $f->getColumn(), $value[$f->getColumn()] ?? ''),
fn ($data): mixed => data_set($data, $f->getColumn(), $value[$f->getColumn()] ?? ''),
$value
);

Expand All @@ -113,11 +113,11 @@ function baseTemplateIterableSaveFile(Item $item, ?UploadedFile $changedFile = n
$file = $changedFile ?? UploadedFile::fake()->create('test.csv');

$data = $changedData ?? [
['file' => $file]
['file' => $file],
];

testTemplateValue($resource, $item, $data, [
['file' => $file->hashName()]
['file' => $file->hashName()],
]);
}

Expand Down Expand Up @@ -149,7 +149,7 @@ function baseTemplateIterableSaveFile(Item $item, ?UploadedFile $changedFile = n
$file = UploadedFile::fake()->create('test.csv');

$data = [
['hidden_file' => $file->hashName()]
['hidden_file' => $file->hashName()],
];

baseTemplateIterableSaveFile($this->item, $file, $data);
Expand Down

0 comments on commit 48a1881

Please sign in to comment.