Skip to content

Commit

Permalink
Apply php-cs-fixer changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pxlrbt authored and github-actions[bot] committed Jun 17, 2022
1 parent 2421449 commit b3d3f2e
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 16 deletions.
1 change: 0 additions & 1 deletion src/Columns/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public function getHeading()
return $this->heading ?? Str::headline($this->name);
}


public function width(Closure | int $width): static
{
$this->width = $width;
Expand Down
3 changes: 1 addition & 2 deletions src/Events/ExportFinishedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ class ExportFinishedEvent
public function __construct(
public string $filename,
public ?int $userId,
)
{
) {
//
}
}
1 change: 0 additions & 1 deletion src/Exports/Concerns/CanQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ protected function prepareQueuedExport()
$this->writerType = $this->getWriterType();
$this->livewireClass = $this->getLivewireClass();


// Reset
$this->generatedColumns = [];
$this->formSchema = [];
Expand Down
2 changes: 1 addition & 1 deletion src/Exports/Concerns/WithColumnFormats.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function columnFormats(): array
return $this->getMapping($this->getModelInstance())
->values()
->mapWithKeys(fn (Column $column, $key) => [
Coordinate::stringFromColumnIndex($key + 1) => $this->evaluate($column->getFormat())
Coordinate::stringFromColumnIndex($key + 1) => $this->evaluate($column->getFormat()),
])
->filter()
->toArray();
Expand Down
14 changes: 6 additions & 8 deletions src/Exports/Concerns/WithColumns.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
use Filament\Forms\Components\Field;
use Filament\Forms\Components\Repeater;
use Filament\Resources\Form;
use Filament\Tables;
use Filament\Resources\Table;
use Filament\Tables;
use Filament\Tables\Contracts\HasTable;
use Illuminate\Database\Schema\Builder;
use Illuminate\Support\Collection;

use pxlrbt\FilamentExcel\Columns\Column;

use function Livewire\invade;
use pxlrbt\FilamentExcel\Columns\Column;

trait WithColumns
{
Expand Down Expand Up @@ -59,7 +57,7 @@ public function fromTable(): static

public function fromForm(): static
{
$this->generatedColumns = fn () => ($this->cachedMap ??= $this->createFieldMappingFromForm())->toArray();
$this->generatedColumns = fn () => ($this->cachedMap ??= $this->createFieldMappingFromForm())->toArray();

return $this;
}
Expand Down Expand Up @@ -102,8 +100,8 @@ protected function createFieldMappingFromForm(): Collection

return $extracted
->filter(fn ($field) => $field instanceof Field)
->mapWithKeys(fn (Field $field) =>
[$field->getName() => Column::make($field->getName())->heading($field->getLabel())]
->mapWithKeys(
fn (Field $field) => [$field->getName() => Column::make($field->getName())->heading($field->getLabel())]
);
}

Expand All @@ -118,7 +116,7 @@ protected function createFieldMappingFromTable(): Collection

return $columns->mapWithKeys(
fn (Tables\Columns\Column $column) => [
$column->getName() => Column::make($column->getName())->heading($column->getLabel())
$column->getName() => Column::make($column->getName())->heading($column->getLabel()),
]
);
}
Expand Down
1 change: 0 additions & 1 deletion src/Exports/Concerns/WithHeadings.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ trait WithHeadings

protected Closure | bool $withNamesAsHeadings = false;


public function withoutHeadings(Closure | bool $condition = true): self
{
$this->withoutHeadings = $condition;
Expand Down
2 changes: 1 addition & 1 deletion src/Exports/Concerns/WithWidths.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function columnWidths(): array
return $this->getMapping($this->getModelInstance())
->values()
->mapWithKeys(fn (Column $column, $key) => [
Coordinate::stringFromColumnIndex($key + 1) => $this->evaluate($column->getWidth())
Coordinate::stringFromColumnIndex($key + 1) => $this->evaluate($column->getWidth()),
])
->filter()
->toArray();
Expand Down
1 change: 0 additions & 1 deletion src/Exports/ExcelExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ public function getModelClass(): ?string

public function hydrate($livewire = null, $records = null, $formData = null): static
{

$this->livewire = $livewire;
$this->modelKeyName = $this->getModelInstance()->getKeyName();
$this->recordIds = $records?->pluck($this->modelKeyName)->toArray() ?? [];
Expand Down
1 change: 1 addition & 0 deletions src/FilamentExcelServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public function sendExportFinishedNotification()
);
}
}

public function cacheExportFinishedNotification(ExportFinishedEvent $event)
{
if ($event->userId === null) {
Expand Down

0 comments on commit b3d3f2e

Please sign in to comment.