Skip to content

Commit 8a78d52

Browse files
ManukMinasyangithub-actions[bot]
authored andcommitted
Fix styling
1 parent 066dcea commit 8a78d52

File tree

7 files changed

+50
-69
lines changed

7 files changed

+50
-69
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: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,13 @@ public function getColumnItemsCount(string | int $columnId): int;
5151

5252
/**
5353
* Create a new record with the given attributes.
54-
*
55-
* @param Form $form
56-
* @param mixed $currentColumn
57-
* @return Model|null
5854
*/
5955
public function createRecord(Form $form, mixed $currentColumn): ?Model;
6056

6157
/**
6258
* Update an existing record with the given attributes.
6359
*
64-
* @param Model $record The record to update
65-
* @param Form $form
66-
* @return bool
60+
* @param Model $record The record to update
6761
*/
6862
public function updateRecord(Model $record, Form $form): bool;
6963

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: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@
2121
use Relaticle\Flowforge\Enums\KanbanColor;
2222
use Relaticle\Flowforge\Filament\Pages\KanbanBoardPage;
2323

24-
class KanbanBoard extends Component implements HasForms, HasActions
24+
class KanbanBoard extends Component implements HasActions, HasForms
2525
{
26+
use InteractsWithActions;
2627
use InteractsWithForms;
2728
use WithPagination;
28-
use InteractsWithActions;
2929

3030
/**
3131
* The name of the kanban board page class.
3232
*/
33-
public KanbanBoardPage|string $pageClass;
33+
public KanbanBoardPage | string $pageClass;
3434

3535
/**
3636
* The Kanban board adapter.
@@ -70,7 +70,7 @@ class KanbanBoard extends Component implements HasForms, HasActions
7070
/**
7171
* The active card for modal operations.
7272
*/
73-
public string|int|null $currentRecord = null;
73+
public string | int | null $currentRecord = null;
7474

7575
/**
7676
* Search query for filtering cards.
@@ -94,18 +94,17 @@ class KanbanBoard extends Component implements HasForms, HasActions
9494
/**
9595
* Initialize the Kanban board.
9696
*
97-
* @param KanbanAdapterInterface $adapter The Kanban adapter
98-
* @param int|null $initialCardsCount The initial number of cards to load per column
99-
* @param int|null $cardsIncrement The number of cards to load on "load more"
100-
* @param array<int, string> $searchable The searchable fields
97+
* @param KanbanAdapterInterface $adapter The Kanban adapter
98+
* @param int|null $initialCardsCount The initial number of cards to load per column
99+
* @param int|null $cardsIncrement The number of cards to load on "load more"
100+
* @param array<int, string> $searchable The searchable fields
101101
*/
102102
public function mount(
103103
KanbanAdapterInterface $adapter,
104-
?int $initialCardsCount = null,
105-
?int $cardsIncrement = null,
106-
array $searchable = []
107-
): void
108-
{
104+
?int $initialCardsCount = null,
105+
?int $cardsIncrement = null,
106+
array $searchable = []
107+
): void {
109108
$this->adapter = $adapter;
110109
$this->searchable = $searchable;
111110
$this->config = $this->adapter->getConfig();
@@ -122,7 +121,7 @@ public function mount(
122121

123122
// Initialize columns
124123
$this->columns = collect($this->config->getColumnValues())
125-
->map(fn($label, $value) => [
124+
->map(fn ($label, $value) => [
126125
'id' => $value,
127126
'label' => $label,
128127
'color' => $this->resolveColumnColors()[$value] ?? null,
@@ -192,7 +191,9 @@ public function createAction(): ?Action
192191
{
193192
$boardPage = app($this->pageClass);
194193

195-
if (!method_exists($boardPage, 'createAction')) return null;
194+
if (! method_exists($boardPage, 'createAction')) {
195+
return null;
196+
}
196197

197198
$action = Action::make('create')
198199
->model(function (Action $action, array $arguments) {
@@ -218,7 +219,9 @@ public function editAction(): ?Action
218219
{
219220
$boardPage = app($this->pageClass);
220221

221-
if (!method_exists($boardPage, 'editAction')) return null;
222+
if (! method_exists($boardPage, 'editAction')) {
223+
return null;
224+
}
222225

223226
$action = Action::make('edit')
224227
->model(function (Action $action, array $arguments) {
@@ -229,6 +232,7 @@ public function editAction(): ?Action
229232
})
230233
->fillForm(function (Action $action, array $arguments) {
231234
$record = $this->adapter->getModelById($arguments['record']);
235+
232236
return $record->toArray();
233237
})
234238
->action(function (Action $action, array $arguments) {
@@ -243,9 +247,9 @@ public function editAction(): ?Action
243247
})
244248
->after(function (Action $action, array $arguments) {
245249
$this->refreshBoard();
246-
250+
247251
$this->dispatch('kanban-record-updated', [
248-
'record' => $this->adapter->getModelById($arguments['record'])
252+
'record' => $this->adapter->getModelById($arguments['record']),
249253
]);
250254
});
251255

@@ -282,30 +286,30 @@ protected function loadColumnsData(): void
282286
/**
283287
* Get items for a specific column.
284288
*
285-
* @param string|int $columnId The column ID
289+
* @param string|int $columnId The column ID
286290
* @return array The formatted items
287291
*/
288-
public function getItemsForColumn(string|int $columnId): array
292+
public function getItemsForColumn(string | int $columnId): array
289293
{
290294
return $this->columnCards[$columnId] ?? [];
291295
}
292296

293297
/**
294298
* Get the total count of items for a specific column.
295299
*
296-
* @param string|int $columnId The column ID
300+
* @param string|int $columnId The column ID
297301
* @return int The total count
298302
*/
299-
public function getColumnItemsCount(string|int $columnId): int
303+
public function getColumnItemsCount(string | int $columnId): int
300304
{
301305
return $this->adapter->getColumnItemsCount($columnId);
302306
}
303307

304308
/**
305309
* Load more items for a column.
306310
*
307-
* @param string $columnId The column ID
308-
* @param int|null $count The number of items to load
311+
* @param string $columnId The column ID
312+
* @param int|null $count The number of items to load
309313
*/
310314
public function loadMoreItems(string $columnId, ?int $count = null): void
311315
{
@@ -323,7 +327,7 @@ public function loadMoreItems(string $columnId, ?int $count = null): void
323327
/**
324328
* Format items for display.
325329
*
326-
* @param Collection $items The items to format
330+
* @param Collection $items The items to format
327331
* @return array The formatted items
328332
*/
329333
protected function formatItems(Collection $items): array
@@ -334,11 +338,11 @@ protected function formatItems(Collection $items): array
334338
/**
335339
* Update the order of cards in a column.
336340
*
337-
* @param int|string $columnId The column ID
338-
* @param array $cardIds The card IDs in their new order
341+
* @param int|string $columnId The column ID
342+
* @param array $cardIds The card IDs in their new order
339343
* @return bool Whether the operation was successful
340344
*/
341-
public function updateRecordsOrderAndColumn(int|string $columnId, array $cardIds): bool
345+
public function updateRecordsOrderAndColumn(int | string $columnId, array $cardIds): bool
342346
{
343347
$success = $this->adapter->updateRecordsOrderAndColumn($columnId, $cardIds);
344348

@@ -354,7 +358,7 @@ public function updateRecordsOrderAndColumn(int|string $columnId, array $cardIds
354358
*/
355359
public function deleteRecord(): void
356360
{
357-
if (!$this->permissions['canDelete']) {
361+
if (! $this->permissions['canDelete']) {
358362
Notification::make()
359363
->title(__('You do not have permission to delete :records', ['records' => $this->config->getPluralCardLabel()]))
360364
->danger()
@@ -365,7 +369,7 @@ public function deleteRecord(): void
365369

366370
$record = $this->adapter->getModelById($this->currentRecord);
367371

368-
if (!$record) {
372+
if (! $record) {
369373
Notification::make()
370374
->title('Record not found')
371375
->danger()

0 commit comments

Comments
 (0)