Skip to content

Commit 75ef0e2

Browse files
ManukMinasyangithub-actions[bot]
authored andcommitted
Fix styling
1 parent 1a2aa02 commit 75ef0e2

File tree

7 files changed

+46
-60
lines changed

7 files changed

+46
-60
lines changed

src/Commands/MakeKanbanBoardCommand.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,15 @@ public function handle(): int
4747
$name = $this->argument('name') ?: $this->ask('Board name?', 'Tasks');
4848
if (empty($name)) {
4949
$this->error('Board name required');
50+
5051
return self::FAILURE;
5152
}
5253

5354
// Get model
5455
$model = $this->option('model') ?: $this->ask('Model?', 'Task');
5556
if (empty($model)) {
5657
$this->error('Model required');
58+
5759
return self::FAILURE;
5860
}
5961

@@ -67,7 +69,7 @@ public function handle(): int
6769

6870
// Check if file exists
6971
if ($this->files->exists($path)) {
70-
if (!$this->confirm("File exists. Overwrite?")) {
72+
if (! $this->confirm('File exists. Overwrite?')) {
7173
return self::FAILURE;
7274
}
7375
}
@@ -79,12 +81,12 @@ public function handle(): int
7981
$this->info("Board created: {$path}");
8082
$this->newLine();
8183

82-
$this->info("Register in admin panel:");
84+
$this->info('Register in admin panel:');
8385
$this->line("->pages([\n App\\Filament\\Pages\\{$className}::class,\n])");
8486

8587
$this->newLine();
86-
$this->info("For create/edit functionality, see documentation at:");
87-
$this->line("https://github.com/relaticle/flowforge");
88+
$this->info('For create/edit functionality, see documentation at:');
89+
$this->line('https://github.com/relaticle/flowforge');
8890

8991
return self::SUCCESS;
9092
}
@@ -117,7 +119,7 @@ protected function getStub(string $name): string
117119
{
118120
$stubPath = __DIR__ . '/../../stubs/' . $name;
119121

120-
if (!$this->files->exists($stubPath)) {
122+
if (! $this->files->exists($stubPath)) {
121123
throw new \RuntimeException("Stub file not found: {$stubPath}");
122124
}
123125

src/Concerns/CrudOperationsTrait.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ trait CrudOperationsTrait
1515
{
1616
/**
1717
* Create a new record with the given attributes.
18-
*
19-
* @param Form $form
20-
* @param mixed $currentColumn
21-
* @return Model|null
2218
*/
2319
public function createRecord(Form $form, mixed $currentColumn): ?Model
2420
{
@@ -41,9 +37,7 @@ public function createRecord(Form $form, mixed $currentColumn): ?Model
4137
/**
4238
* Update an existing record with the given attributes.
4339
*
44-
* @param Model $record The record to update
45-
* @param Form $form
46-
* @return bool
40+
* @param Model $record The record to update
4741
*/
4842
public function updateRecord(Model $record, Form $form): bool
4943
{
@@ -57,7 +51,7 @@ public function updateRecord(Model $record, Form $form): bool
5751
/**
5852
* Delete an existing record.
5953
*
60-
* @param Model $record The record to delete
54+
* @param Model $record The record to delete
6155
*/
6256
public function deleteRecord(Model $record): bool
6357
{
@@ -67,11 +61,11 @@ public function deleteRecord(Model $record): bool
6761
/**
6862
* Update the order of records in a column.
6963
*
70-
* @param string|int $columnId The column ID
71-
* @param array<int, mixed> $recordIds The record IDs in their new order
64+
* @param string|int $columnId The column ID
65+
* @param array<int, mixed> $recordIds The record IDs in their new order
7266
* @return bool Whether the operation was successful
7367
*/
74-
public function updateRecordsOrderAndColumn(string|int $columnId, array $recordIds): bool
68+
public function updateRecordsOrderAndColumn(string | int $columnId, array $recordIds): bool
7569
{
7670
$orderField = $this->config->getOrderField();
7771
$columnField = $this->config->getColumnField();

src/Config/KanbanConfig.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,6 @@ public function with(array $properties): self
230230
return new self(...$config);
231231
}
232232

233-
/**
234-
* @return array
235-
*/
236233
public function toLivewire(): array
237234
{
238235
return [
@@ -248,10 +245,6 @@ public function toLivewire(): array
248245
];
249246
}
250247

251-
/**
252-
* @param $value
253-
* @return KanbanConfig
254-
*/
255248
public static function fromLivewire($value): KanbanConfig
256249
{
257250
return new KanbanConfig(

src/Contracts/KanbanAdapterInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Relaticle\Flowforge\Contracts;
66

7-
use Filament\Forms\Form;
87
use Illuminate\Database\Eloquent\Model;
98
use Illuminate\Support\Collection;
109
use Relaticle\Flowforge\Config\KanbanConfig;

src/Contracts/KanbanBoardPageInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface KanbanBoardPageInterface
1111
{
1212
public function getSubject(): Builder;
1313

14-
// public function createAction(Action $action): Action;
15-
//
16-
// public function editAction(Action $action): Action;
14+
// public function createAction(Action $action): Action;
15+
//
16+
// public function editAction(Action $action): Action;
1717
}

src/Filament/Pages/KanbanBoardPage.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public function __construct()
3131
/**
3232
* Set the field that stores the column value.
3333
*
34-
* @param string $field
3534
* @return KanbanBoardPage
3635
*/
3736
public function columnField(string $field): static
@@ -56,7 +55,6 @@ public function columns(array $columns): static
5655
/**
5756
* Set the title field for the Kanban cards.
5857
*
59-
* @param string $field
6058
* @return KanbanBoardPage
6159
*/
6260
public function titleField(string $field): static
@@ -69,7 +67,6 @@ public function titleField(string $field): static
6967
/**
7068
* Set the description field for the Kanban cards.
7169
*
72-
* @param string $field
7370
* @return KanbanBoardPage
7471
*/
7572
public function descriptionField(string $field): static
@@ -106,7 +103,6 @@ public function columnColors(?array $colors = null): static
106103
/**
107104
* Set the order field for the Kanban board.
108105
*
109-
* @param string $field
110106
* @return KanbanBoardPage
111107
*/
112108
public function orderField(string $field): static
@@ -119,7 +115,6 @@ public function orderField(string $field): static
119115
/**
120116
* Set the label for individual cards.
121117
*
122-
* @param string $label
123118
* @return KanbanBoardPage
124119
*/
125120
public function cardLabel(string $label): static
@@ -139,7 +134,6 @@ public function cardLabel(string $label): static
139134
/**
140135
* Set the plural label for multiple cards.
141136
*
142-
* @param string $label
143137
* @return KanbanBoardPage
144138
*/
145139
public function pluralCardLabel(string $label): static

src/Livewire/KanbanBoard.php

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
use Relaticle\Flowforge\Enums\KanbanColor;
2121
use Relaticle\Flowforge\Filament\Pages\KanbanBoardPage;
2222

23-
class KanbanBoard extends Component implements HasForms, HasActions
23+
class KanbanBoard extends Component implements HasActions, HasForms
2424
{
25+
use InteractsWithActions;
2526
use InteractsWithForms;
2627
use WithPagination;
27-
use InteractsWithActions;
2828

2929
/**
3030
* The name of the kanban board page class.
3131
*/
32-
public KanbanBoardPage|string $pageClass;
32+
public KanbanBoardPage | string $pageClass;
3333

3434
/**
3535
* The Kanban board adapter.
@@ -69,7 +69,7 @@ class KanbanBoard extends Component implements HasForms, HasActions
6969
/**
7070
* The active card for modal operations.
7171
*/
72-
public string|int|null $currentRecord = null;
72+
public string | int | null $currentRecord = null;
7373

7474
/**
7575
* Search query for filtering cards.
@@ -91,18 +91,17 @@ class KanbanBoard extends Component implements HasForms, HasActions
9191
/**
9292
* Initialize the Kanban board.
9393
*
94-
* @param KanbanAdapterInterface $adapter The Kanban adapter
95-
* @param int|null $initialCardsCount The initial number of cards to load per column
96-
* @param int|null $cardsIncrement The number of cards to load on "load more"
97-
* @param array<int, string> $searchable The searchable fields
94+
* @param KanbanAdapterInterface $adapter The Kanban adapter
95+
* @param int|null $initialCardsCount The initial number of cards to load per column
96+
* @param int|null $cardsIncrement The number of cards to load on "load more"
97+
* @param array<int, string> $searchable The searchable fields
9898
*/
9999
public function mount(
100100
KanbanAdapterInterface $adapter,
101-
?int $initialCardsCount = null,
102-
?int $cardsIncrement = null,
103-
array $searchable = []
104-
): void
105-
{
101+
?int $initialCardsCount = null,
102+
?int $cardsIncrement = null,
103+
array $searchable = []
104+
): void {
106105
$this->adapter = $adapter;
107106
$this->searchable = $searchable;
108107
$this->config = $this->adapter->getConfig();
@@ -113,7 +112,7 @@ public function mount(
113112

114113
// Initialize columns
115114
$this->columns = collect($this->config->getColumnValues())
116-
->map(fn($label, $value) => [
115+
->map(fn ($label, $value) => [
117116
'id' => $value,
118117
'label' => $label,
119118
'color' => $this->resolveColumnColors()[$value] ?? null,
@@ -183,7 +182,9 @@ public function createAction(): ?Action
183182
{
184183
$boardPage = app($this->pageClass);
185184

186-
if (!method_exists($boardPage, 'createAction')) return null;
185+
if (! method_exists($boardPage, 'createAction')) {
186+
return null;
187+
}
187188

188189
$action = Action::make('create')
189190
->model(function (Action $action, array $arguments) {
@@ -209,7 +210,9 @@ public function editAction(): ?Action
209210
{
210211
$boardPage = app($this->pageClass);
211212

212-
if (!method_exists($boardPage, 'editAction')) return null;
213+
if (! method_exists($boardPage, 'editAction')) {
214+
return null;
215+
}
213216

214217
$action = Action::make('edit')
215218
->model(function (Action $action, array $arguments) {
@@ -220,6 +223,7 @@ public function editAction(): ?Action
220223
})
221224
->fillForm(function (Action $action, array $arguments) {
222225
$record = $this->adapter->getModelById($arguments['record']);
226+
223227
return $record->toArray();
224228
})
225229
->action(function (Action $action, array $arguments) {
@@ -236,7 +240,7 @@ public function editAction(): ?Action
236240
$this->refreshBoard();
237241

238242
$this->dispatch('kanban-record-updated', [
239-
'record' => $this->adapter->getModelById($arguments['record'])
243+
'record' => $this->adapter->getModelById($arguments['record']),
240244
]);
241245
});
242246

@@ -273,30 +277,30 @@ protected function loadColumnsData(): void
273277
/**
274278
* Get items for a specific column.
275279
*
276-
* @param string|int $columnId The column ID
280+
* @param string|int $columnId The column ID
277281
* @return array The formatted items
278282
*/
279-
public function getItemsForColumn(string|int $columnId): array
283+
public function getItemsForColumn(string | int $columnId): array
280284
{
281285
return $this->columnCards[$columnId] ?? [];
282286
}
283287

284288
/**
285289
* Get the total count of items for a specific column.
286290
*
287-
* @param string|int $columnId The column ID
291+
* @param string|int $columnId The column ID
288292
* @return int The total count
289293
*/
290-
public function getColumnItemsCount(string|int $columnId): int
294+
public function getColumnItemsCount(string | int $columnId): int
291295
{
292296
return $this->adapter->getColumnItemsCount($columnId);
293297
}
294298

295299
/**
296300
* Load more items for a column.
297301
*
298-
* @param string $columnId The column ID
299-
* @param int|null $count The number of items to load
302+
* @param string $columnId The column ID
303+
* @param int|null $count The number of items to load
300304
*/
301305
public function loadMoreItems(string $columnId, ?int $count = null): void
302306
{
@@ -314,7 +318,7 @@ public function loadMoreItems(string $columnId, ?int $count = null): void
314318
/**
315319
* Format items for display.
316320
*
317-
* @param Collection $items The items to format
321+
* @param Collection $items The items to format
318322
* @return array The formatted items
319323
*/
320324
protected function formatItems(Collection $items): array
@@ -325,11 +329,11 @@ protected function formatItems(Collection $items): array
325329
/**
326330
* Update the order of cards in a column.
327331
*
328-
* @param int|string $columnId The column ID
329-
* @param array $cardIds The card IDs in their new order
332+
* @param int|string $columnId The column ID
333+
* @param array $cardIds The card IDs in their new order
330334
* @return bool Whether the operation was successful
331335
*/
332-
public function updateRecordsOrderAndColumn(int|string $columnId, array $cardIds): bool
336+
public function updateRecordsOrderAndColumn(int | string $columnId, array $cardIds): bool
333337
{
334338
$success = $this->adapter->updateRecordsOrderAndColumn($columnId, $cardIds);
335339

0 commit comments

Comments
 (0)