Skip to content

Commit ede3c10

Browse files
ManukMinasyangithub-actions[bot]
authored andcommitted
Fix styling
1 parent 7a11d09 commit ede3c10

File tree

4 files changed

+84
-85
lines changed

4 files changed

+84
-85
lines changed

src/Commands/MakeKanbanBoardCommand.php

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -45,99 +45,103 @@ public function handle(): int
4545
{
4646
// Get the name argument
4747
$name = $this->argument('name');
48-
48+
4949
// Prompt for name if not provided
5050
if (empty($name)) {
5151
$name = $this->ask('What should be the name of the board?');
52-
52+
5353
if (empty($name)) {
5454
$this->error('A name for the board is required!');
55+
5556
return self::FAILURE;
5657
}
5758
}
58-
59+
5960
// Get or prompt for model
6061
$model = $this->option('model');
6162
if (empty($model)) {
6263
$model = $this->ask('What model should this board use?');
63-
64+
6465
if (empty($model)) {
6566
$this->error('A model class is required!');
67+
6668
return self::FAILURE;
6769
}
6870
}
69-
71+
7072
// Get panel with default
7173
$panel = $this->option('panel');
7274
if (empty($panel)) {
7375
$panel = $this->ask('Which Filament panel should this board be added to? (Leave empty for default structure)', '');
7476
}
75-
77+
7678
// Convert to proper case
7779
$className = Str::studly($name) . 'BoardPage';
7880
$modelClass = Str::studly($model);
79-
81+
8082
// Determine file path based on panel
81-
$path = empty($panel)
83+
$path = empty($panel)
8284
? app_path('Filament/Pages/' . $className . '.php')
8385
: app_path('Filament/' . Str::studly($panel) . '/Pages/' . $className . '.php');
84-
86+
8587
// Create directories if they don't exist
8688
$this->files->ensureDirectoryExists(dirname($path));
87-
89+
8890
// Check if file already exists
8991
if ($this->files->exists($path)) {
9092
if (! $this->confirm("The file {$path} already exists. Do you want to overwrite it?")) {
9193
$this->error('Command cancelled!');
94+
9295
return self::FAILURE;
9396
}
9497
}
95-
98+
9699
// Create the board page file
97100
$content = $this->buildClass($className, $modelClass, $panel);
98101
$this->files->put($path, $content);
99-
102+
100103
$this->info("Kanban board page [{$className}] created successfully!");
101104
$this->info("File created at: {$path}");
102-
105+
103106
return self::SUCCESS;
104107
}
105-
108+
106109
/**
107110
* Build the class file content using the stub.
108111
*/
109112
protected function buildClass(string $className, string $modelClass, string $panel): string
110113
{
111114
$stub = $this->getStub();
112-
115+
113116
$namespace = empty($panel)
114-
? "App\\Filament\\Pages"
115-
: "App\\Filament\\" . Str::studly($panel) . "\\Pages";
117+
? 'App\\Filament\\Pages'
118+
: 'App\\Filament\\' . Str::studly($panel) . '\\Pages';
116119
$modelNamespace = 'App\\Models\\' . $modelClass;
117-
120+
118121
// Replace the stub placeholders
119122
$stub = str_replace('{{ namespace }}', $namespace, $stub);
120123
$stub = str_replace('{{ class }}', $className, $stub);
121124
$stub = str_replace('{{ model }}', $modelClass, $stub);
122125
$stub = str_replace('{{ modelNamespace }}', $modelNamespace, $stub);
123126
$stub = str_replace('{{ navigationLabel }}', $className, $stub);
124127
$stub = str_replace('{{ title }}', $modelClass . ' Board', $stub);
125-
128+
126129
return $stub;
127130
}
128-
131+
129132
/**
130133
* Get the stub file for the generator.
131134
*/
132135
protected function getStub(): string
133136
{
134137
$stubPath = __DIR__ . '/../../stubs/kanban-board-page.stub';
135-
136-
if (!$this->files->exists($stubPath)) {
138+
139+
if (! $this->files->exists($stubPath)) {
137140
$this->error("Stub file not found at: {$stubPath}");
141+
138142
throw new \RuntimeException("Stub file not found at: {$stubPath}");
139143
}
140-
144+
141145
return $this->files->get($stubPath);
142146
}
143-
}
147+
}

src/Config/KanbanConfig.php

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,16 @@
2929
final readonly class KanbanConfig implements Wireable
3030
{
3131
public function __construct(
32-
private string $columnField = 'status',
33-
private array $columnValues = [],
34-
private array|bool|null $columnColors = null,
35-
private string $titleField = 'title',
36-
private ?string $descriptionField = null,
37-
private array $cardAttributes = [],
38-
private ?string $orderField = null,
39-
private ?string $cardLabel = null,
40-
private ?string $pluralCardLabel = null,
41-
)
42-
{
43-
}
32+
private string $columnField = 'status',
33+
private array $columnValues = [],
34+
private array | bool | null $columnColors = null,
35+
private string $titleField = 'title',
36+
private ?string $descriptionField = null,
37+
private array $cardAttributes = [],
38+
private ?string $orderField = null,
39+
private ?string $cardLabel = null,
40+
private ?string $pluralCardLabel = null,
41+
) {}
4442

4543
/**
4644
* Get the field that stores the column value.
@@ -67,7 +65,7 @@ public function getColumnValues(): array
6765
*
6866
* @return array|bool|null Map of column values to color codes, or null if not set
6967
*/
70-
public function getColumnColors(): array|bool|null
68+
public function getColumnColors(): array | bool | null
7169
{
7270
return $this->columnColors;
7371
}
@@ -135,8 +133,8 @@ public function getPluralCardLabel(): ?string
135133
/**
136134
* Get the default form schema for creating cards.
137135
*
138-
* @param string $titleField The field name used for card titles
139-
* @param string|null $descriptionField Optional field name for card descriptions
136+
* @param string $titleField The field name used for card titles
137+
* @param string|null $descriptionField Optional field name for card descriptions
140138
* @return array<\Filament\Forms\Components\Component> The default form schema
141139
*/
142140
public static function getDefaultCreateFormSchema(string $titleField, ?string $descriptionField): array
@@ -157,19 +155,18 @@ public static function getDefaultCreateFormSchema(string $titleField, ?string $d
157155
/**
158156
* Get the default form schema for editing cards.
159157
*
160-
* @param string $titleField The field name used for card titles
161-
* @param string|null $descriptionField Optional field name for card descriptions
162-
* @param string $columnField The field name that determines which column a card belongs to
163-
* @param array<string, string> $columnValues Available column values with their labels
158+
* @param string $titleField The field name used for card titles
159+
* @param string|null $descriptionField Optional field name for card descriptions
160+
* @param string $columnField The field name that determines which column a card belongs to
161+
* @param array<string, string> $columnValues Available column values with their labels
164162
* @return array<\Filament\Forms\Components\Component> The default form schema
165163
*/
166164
public static function getDefaultEditFormSchema(
167-
string $titleField,
165+
string $titleField,
168166
?string $descriptionField,
169-
string $columnField,
170-
array $columnValues
171-
): array
172-
{
167+
string $columnField,
168+
array $columnValues
169+
): array {
173170
$schema = [
174171
TextInput::make($titleField)
175172
->required()
@@ -195,21 +192,21 @@ public static function getDefaultEditFormSchema(
195192
* For example, `withColumnField('status')` will create a new configuration
196193
* with the columnField property set to 'status'.
197194
*
198-
* @param string $method The method name
199-
* @param array $arguments The method arguments
195+
* @param string $method The method name
196+
* @param array $arguments The method arguments
200197
* @return self A new instance with the updated property
201198
*
202199
* @throws \BadMethodCallException If the method is not a valid with* method or targets a non-existent property
203200
*/
204201
public function __call(string $method, array $arguments): self
205202
{
206-
if (!Str::startsWith($method, 'with')) {
203+
if (! Str::startsWith($method, 'with')) {
207204
throw new \BadMethodCallException("Method {$method} not found");
208205
}
209206

210207
$property = lcfirst(Str::after($method, 'with'));
211208

212-
if (!property_exists($this, $property)) {
209+
if (! property_exists($this, $property)) {
213210
throw new \BadMethodCallException("Property {$property} not found");
214211
}
215212

@@ -219,7 +216,7 @@ public function __call(string $method, array $arguments): self
219216
/**
220217
* Create a new configuration with the specified properties updated.
221218
*
222-
* @param array<string, mixed> $properties The properties to update
219+
* @param array<string, mixed> $properties The properties to update
223220
* @return self A new instance with the updated properties
224221
*/
225222
public function with(array $properties): self

src/FlowforgeServiceProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Filament\Support\Assets\Js;
99
use Filament\Support\Facades\FilamentAsset;
1010
use Filament\Support\Facades\FilamentIcon;
11-
use Illuminate\Filesystem\Filesystem;
1211
use Illuminate\Support\Facades\Blade;
1312
use Livewire\Features\SupportTesting\Testable;
1413
use Livewire\Livewire;

0 commit comments

Comments
 (0)