Skip to content

Commit fba785a

Browse files
committed
Fix styling
1 parent 3558a39 commit fba785a

File tree

2 files changed

+29
-26
lines changed

2 files changed

+29
-26
lines changed

packages/prompts/src/Filament/Components/RunCommandComponent.php

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ protected function runCommand(): void
8888
// Stelle sicher, dass publishable Resources registriert sind (auch im Web-Kontext)
8989
// Dies löst das Problem, dass Spatie Package Tools nur registriert, wenn runningInConsole() true ist
9090
WebCommandRunner::ensurePublishableResourcesRegistered();
91-
91+
9292
$this->responseStore->resetCounter();
9393

9494
foreach ($this->answers as $promptId => $answer) {
@@ -129,7 +129,7 @@ protected function runCommand(): void
129129
// Kumulativer Output: Füge neuen Output zum bestehenden hinzu
130130
if (! empty($newOutput)) {
131131
if (! empty($this->output)) {
132-
$this->output .= "\n" . $newOutput;
132+
$this->output .= "\n".$newOutput;
133133
} else {
134134
$this->output = $newOutput;
135135
}
@@ -143,14 +143,14 @@ protected function runCommand(): void
143143
// Kumulativer Output: Füge neuen Output zum bestehenden hinzu
144144
if (! empty($newOutput)) {
145145
if (! empty($this->output)) {
146-
$this->output .= "\n" . $newOutput;
146+
$this->output .= "\n".$newOutput;
147147
} else {
148148
$this->output = $newOutput;
149149
}
150150
}
151151
// Zeige kumulativen Output während Prompts für Debugging
152152
$this->currentStepOutput = $this->output ?? '';
153-
153+
154154
$prompt = $e->getPrompt();
155155
$this->currentPrompt = $prompt;
156156
$this->executionStep++;
@@ -177,7 +177,7 @@ protected function runCommand(): void
177177
// Kumulativer Output auch bei Exceptions
178178
if (! empty($newOutput)) {
179179
if (! empty($this->output)) {
180-
$this->output .= "\n" . $newOutput;
180+
$this->output .= "\n".$newOutput;
181181
} else {
182182
$this->output = $newOutput;
183183
}
@@ -288,14 +288,14 @@ public function submitPrompt(): void
288288
// Capture Filament validation errors
289289
$errors = $e->errors();
290290
$this->validationErrors = [];
291-
291+
292292
// Get errors for current prompt field
293293
if (isset($errors[$promptId])) {
294-
$this->validationErrors = is_array($errors[$promptId])
295-
? $errors[$promptId]
294+
$this->validationErrors = is_array($errors[$promptId])
295+
? $errors[$promptId]
296296
: [$errors[$promptId]];
297297
}
298-
298+
299299
// If no specific field errors, get all errors
300300
if (empty($this->validationErrors)) {
301301
foreach ($errors as $fieldErrors) {
@@ -306,7 +306,7 @@ public function submitPrompt(): void
306306
}
307307
}
308308
}
309-
309+
310310
return;
311311
}
312312
}
@@ -315,16 +315,19 @@ public function submitPrompt(): void
315315
if ($this->currentPrompt['method'] === 'confirm') {
316316
if ($answer === null) {
317317
$this->validatePromptAnswer($promptId, null, $this->currentPrompt);
318+
318319
return;
319320
}
320321
} elseif ($this->currentPrompt['method'] === 'select') {
321322
// Für Select: Prüfe ob leer oder null
322323
if ($answer === null || $answer === '' || $answer === '0') {
323324
$this->validatePromptAnswer($promptId, $answer, $this->currentPrompt);
325+
324326
return;
325327
}
326328
} elseif ($answer === null || $answer === '') {
327329
$this->validatePromptAnswer($promptId, '', $this->currentPrompt);
330+
328331
return;
329332
}
330333

@@ -456,7 +459,7 @@ protected function validatePromptAnswer(string $promptId, mixed $answer, array $
456459
$messages["{$promptId}.required"] = 'Bitte mindestens eine Option wählen.';
457460
$messages["{$promptId}.min"] = 'Bitte mindestens eine Option wählen.';
458461
}
459-
462+
460463
// Freundlichere Meldungen speziell für Select
461464
if ($method === 'select') {
462465
$messages["{$promptId}.required"] = 'Bitte wählen Sie eine Option aus.';
@@ -582,16 +585,16 @@ protected function createFieldFromPrompt(string $promptId, string $method, array
582585
if ($required) {
583586
$rules[] = 'required';
584587
}
585-
588+
586589
// Add method-specific rules
587590
if ($method === 'select' && $required && ! empty($options)) {
588591
$rules[] = 'in:'.implode(',', array_keys($options));
589592
}
590-
593+
591594
if ($method === 'confirm') {
592595
$rules[] = 'boolean';
593596
}
594-
597+
595598
$pushRules($rules, $validate);
596599

597600
// Kein automatisches Default für Select - Validation wird verwendet

packages/prompts/src/Support/WebCommandRunner.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected static function getProviderInstance($app, string $providerClass)
5353
protected static function getPackage(PackageServiceProvider $provider)
5454
{
5555
$reflection = new \ReflectionClass($provider);
56-
56+
5757
if (! $reflection->hasProperty('package')) {
5858
return null;
5959
}
@@ -89,7 +89,7 @@ protected static function registerConfigPublishes(PackageServiceProvider $provid
8989

9090
foreach ($configFileNames as $configFileName) {
9191
$vendorConfig = $basePathMethod("/../config/{$configFileName}.php");
92-
92+
9393
if (! is_file($vendorConfig)) {
9494
$vendorConfig = $basePathMethod("/../config/{$configFileName}.php.stub");
9595
if (! is_file($vendorConfig)) {
@@ -98,7 +98,7 @@ protected static function registerConfigPublishes(PackageServiceProvider $provid
9898
}
9999

100100
static::callPublishes($provider, [
101-
$vendorConfig => config_path("{$configFileName}.php")
101+
$vendorConfig => config_path("{$configFileName}.php"),
102102
], "{$shortName}-config");
103103
}
104104
}
@@ -123,7 +123,7 @@ protected static function registerMigrationPublishes(PackageServiceProvider $pro
123123
}
124124

125125
static::callPublishes($provider, [
126-
$vendorMigration => database_path("migrations/{$migrationFileName}.php")
126+
$vendorMigration => database_path("migrations/{$migrationFileName}.php"),
127127
], "{$shortName}-migrations");
128128
}
129129
}
@@ -143,7 +143,7 @@ protected static function registerViewPublishes(PackageServiceProvider $provider
143143
}
144144

145145
static::callPublishes($provider, [
146-
$viewsPath => base_path("resources/views/vendor/{$shortName}")
146+
$viewsPath => base_path("resources/views/vendor/{$shortName}"),
147147
], "{$shortName}-views");
148148
}
149149

@@ -166,7 +166,7 @@ protected static function registerTranslationPublishes(PackageServiceProvider $p
166166
: resource_path("lang/vendor/{$shortName}");
167167

168168
static::callPublishes($provider, [
169-
$vendorTranslations => $appTranslations
169+
$vendorTranslations => $appTranslations,
170170
], "{$shortName}-translations");
171171
}
172172

@@ -185,21 +185,21 @@ protected static function registerAssetPublishes(PackageServiceProvider $provide
185185
}
186186

187187
static::callPublishes($provider, [
188-
$vendorAssets => public_path("vendor/{$shortName}")
188+
$vendorAssets => public_path("vendor/{$shortName}"),
189189
], "{$shortName}-assets");
190190
}
191191

192192
protected static function getPackageProperty($package, string $property)
193193
{
194194
$reflection = new \ReflectionClass($package);
195-
195+
196196
if (! $reflection->hasProperty($property)) {
197197
return null;
198198
}
199199

200200
$prop = $reflection->getProperty($property);
201201
$prop->setAccessible(true);
202-
202+
203203
return $prop->getValue($package);
204204
}
205205

@@ -208,7 +208,7 @@ protected static function getPackageMethod($package, string $method): callable
208208
$reflection = new \ReflectionClass($package);
209209
$methodRef = $reflection->getMethod($method);
210210
$methodRef->setAccessible(true);
211-
211+
212212
return fn (...$args) => $methodRef->invoke($package, ...$args);
213213
}
214214

@@ -217,7 +217,7 @@ protected static function invokePackageMethod($package, string $method)
217217
$reflection = new \ReflectionClass($package);
218218
$methodRef = $reflection->getMethod($method);
219219
$methodRef->setAccessible(true);
220-
220+
221221
return $methodRef->invoke($package);
222222
}
223223

@@ -228,4 +228,4 @@ protected static function callPublishes(PackageServiceProvider $provider, array
228228
$method->setAccessible(true);
229229
$method->invoke($provider, $paths, $group);
230230
}
231-
}
231+
}

0 commit comments

Comments
 (0)