Skip to content

Commit c67266f

Browse files
pxlrbtgithub-actions[bot]
authored andcommitted
Apply style changes
1 parent 16b2580 commit c67266f

14 files changed

+27
-25
lines changed

src/Actions/Tables/ExportBulkAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static function getDefaultName(): ?string
2020
protected function setUp(): void
2121
{
2222
parent::setUp();
23-
23+
2424
$this->parentSetUp();
2525

2626
$this->deselectRecordsAfterCompletion();

src/Columns/Column.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function format(Closure|string $format): static
8484

8585
public function tableColumn(TableColumn $tableColumn): static
8686
{
87-
$clone = clone($tableColumn);
87+
$clone = clone $tableColumn;
8888

8989
// Try to remove all closures
9090
foreach ((new ReflectionClass($clone))->getProperties() as $property) {

src/Exports/Concerns/WithColumns.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
use Filament\Tables\Contracts\HasTable;
1212
use Illuminate\Database\Schema\Builder;
1313
use Illuminate\Support\Collection;
14-
use function Livewire\invade;
1514
use pxlrbt\FilamentExcel\Columns\Column;
1615

16+
use function Livewire\invade;
17+
1718
trait WithColumns
1819
{
1920
public Closure|array $columns = [];
@@ -24,7 +25,7 @@ trait WithColumns
2425

2526
protected ?string $columnsSource = null;
2627

27-
public function withColumns(Closure|array|string|null $columns = null): static
28+
public function withColumns(Closure|array|string $columns = null): static
2829
{
2930
if (is_callable($columns)) {
3031
$this->columns = $columns;

src/Exports/Concerns/WithHeadings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
trait WithHeadings
99
{
10-
public array|null $headings = null;
10+
public ?array $headings = null;
1111

1212
protected Closure|bool $withoutHeadings = false;
1313

src/Exports/Concerns/WithMapping.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function getMapping($row): Collection
2121
// If user didn't specify a custom except array, use the hidden columns.
2222
// User can override this by passing an empty array ->except([])
2323
// When user specifies with only(), ignore if the column is hidden or not.
24-
if ($except === null && (!is_array($only) || count($only) === 0)) {
24+
if ($except === null && (! is_array($only) || count($only) === 0)) {
2525
$except = $row->getHidden();
2626
}
2727
}
@@ -38,7 +38,7 @@ public function getMapping($row): Collection
3838
}
3939

4040
/**
41-
* @param Model|mixed $record
41+
* @param Model|mixed $record
4242
*/
4343
public function map($record): array
4444
{
@@ -51,7 +51,7 @@ public function map($record): array
5151

5252
foreach ($columns as $column) {
5353
$state = $this->getState($column, $record);
54-
$state = $this->applyFormatStateUsing($column, $record, $state);
54+
$state = $this->applyFormatStateUsing($column, $record, $state);
5555

5656
$result[$column->getName()] = app(Formatter::class)->format($state);
5757
}
@@ -73,9 +73,9 @@ private function getState(Column $column, $record)
7373
$arrayState = $column->getStateUsing === null
7474
? $state
7575
: $this->evaluate($column->getStateUsing->getClosure(), [
76-
'column' => $column->tableColumn,
76+
'column' => $column->tableColumn,
7777
'livewire' => $this->getLivewire(),
78-
'record' => $record,
78+
'record' => $record,
7979
]);
8080

8181
if ($this->columnsSource === 'table' && is_string($arrayState) && ($separator = $column->tableColumn->getSeparator())) {
@@ -100,10 +100,10 @@ private function applyFormatStateUsing(Column $column, $record, $state)
100100
$state = $column->formatStateUsing === null
101101
? $state
102102
: $this->evaluate($column->formatStateUsing->getClosure(), [
103-
'column' => $column->tableColumn,
103+
'column' => $column->tableColumn,
104104
'livewire' => $this->getLivewire(),
105-
'record' => $record,
106-
'state' => $state,
105+
'record' => $record,
106+
'state' => $state,
107107
]);
108108

109109
$formattedState[] = $state;

src/Exports/Concerns/WithWriterType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait WithWriterType
99
{
1010
protected Closure|string|null $writerType = null;
1111

12-
public function withWriterType(Closure|string|null $writerType = null): static
12+
public function withWriterType(Closure|string $writerType = null): static
1313
{
1414
$this->writerType = $writerType;
1515

src/Exports/ExcelExport.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
use Illuminate\Database\Eloquent\Model;
1111
use Illuminate\Support\Str;
1212
use Livewire\Component;
13-
use pxlrbt\FilamentExcel\Exports\Concerns\CanIgnoreFormatting;
14-
use function Livewire\invade;
1513
use Maatwebsite\Excel\Concerns\Exportable;
1614
use Maatwebsite\Excel\Concerns\FromQuery;
1715
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
@@ -21,6 +19,7 @@
2119
use Maatwebsite\Excel\Concerns\WithHeadings as HasHeadings;
2220
use Maatwebsite\Excel\Concerns\WithMapping as HasMapping;
2321
use pxlrbt\FilamentExcel\Events\ExportFinishedEvent;
22+
use pxlrbt\FilamentExcel\Exports\Concerns\CanIgnoreFormatting;
2423
use pxlrbt\FilamentExcel\Exports\Concerns\CanModifyQuery;
2524
use pxlrbt\FilamentExcel\Exports\Concerns\CanQueue;
2625
use pxlrbt\FilamentExcel\Exports\Concerns\Except;
@@ -36,6 +35,8 @@
3635
use pxlrbt\FilamentExcel\Interactions\AskForFilename;
3736
use pxlrbt\FilamentExcel\Interactions\AskForWriterType;
3837

38+
use function Livewire\invade;
39+
3940
class ExcelExport implements HasMapping, HasHeadings, FromQuery, ShouldAutoSize, WithColumnWidths, WithColumnFormatting, WithCustomChunkSize
4041
{
4142
use Exportable, CanQueue {

src/Exports/Formatters/ArrayFormatter.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ class ArrayFormatter implements FormatterInterface
66
{
77
public function __construct(
88
public string $delimiter = ','
9-
)
10-
{
9+
) {
1110
//
1211
}
1312

src/Exports/Formatters/EnumFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ public function shouldApply($state): bool
1313

1414
public function format($state): string
1515
{
16-
return $state->value;
16+
return $state->value;
1717
}
1818
}

src/Exports/Formatters/Formatter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
class Formatter
88
{
9-
static protected $formatters = [
9+
protected static $formatters = [
1010
ArrayFormatter::class,
1111
EnumFormatter::class,
1212
ObjectFormatter::class,
1313
];
1414

1515
/**
16-
* @param mixed $state
16+
* @param mixed $state
1717
* @return mixed
1818
*/
1919
public function format($state)

src/Exports/Formatters/FormatterInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
interface FormatterInterface
66
{
77
public function shouldApply($state): bool;
8+
89
public function format($state): string;
910
}

src/FilamentExcelServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
use Illuminate\Support\Facades\Event;
1010
use Illuminate\Support\Facades\Storage;
1111
use Illuminate\Support\Facades\URL;
12-
use Spatie\LaravelPackageTools\Package;
13-
use Spatie\LaravelPackageTools\PackageServiceProvider;
1412
use Illuminate\Support\Str;
1513
use pxlrbt\FilamentExcel\Commands\PruneExportsCommand;
1614
use pxlrbt\FilamentExcel\Events\ExportFinishedEvent;
15+
use Spatie\LaravelPackageTools\Package;
16+
use Spatie\LaravelPackageTools\PackageServiceProvider;
1717

1818
class FilamentExcelServiceProvider extends PackageServiceProvider
1919
{

src/Interactions/AskForFilename.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
trait AskForFilename
88
{
9-
public function askForFilename(?string $default = null, ?string $label = null, ?callable $callback = null): self
9+
public function askForFilename(string $default = null, string $label = null, callable $callback = null): self
1010
{
1111
$field = TextInput::make('filename')
1212
->label($label ?? __('Filename'))

src/Interactions/AskForWriterType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
trait AskForWriterType
99
{
10-
public function askForWriterType(?string $default = null, ?array $options = null, ?string $label = null, ?callable $callback = null): self
10+
public function askForWriterType(string $default = null, array $options = null, string $label = null, callable $callback = null): self
1111
{
1212
$options = $options ?: [
1313
Excel::XLS => 'XLS',

0 commit comments

Comments
 (0)