Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenjude authored and github-actions[bot] committed Feb 29, 2024
1 parent 8e7162a commit c649dd5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/Commands/FilamentJetstreamCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ public function handle(): int
{
$this->info('Filament Jetstream scaffolding...');

if (!$this->installComposerPackages()) {
if (! $this->installComposerPackages()) {
return self::FAILURE;
}

$options = array_filter(['--teams' => $this->option('teams'), '--api' => $this->option('api'),]);
$options = array_filter(['--teams' => $this->option('teams'), '--api' => $this->option('api')]);

$options = implode(' ', (array_keys($options)));

Expand Down Expand Up @@ -56,11 +56,11 @@ public function handle(): int
*/
protected function installComposerPackages(): bool
{
if (!$this->hasComposerPackage('filament/filament')) {
if (! $this->hasComposerPackage('filament/filament')) {
return $this->requireComposerPackages('filament/filament:^3.2');
}

if (!$this->hasComposerPackage('laravel/jetstream')) {
if (! $this->hasComposerPackage('laravel/jetstream')) {
return $this->requireComposerPackages('laravel/jetstream:^4.2');
}

Expand Down Expand Up @@ -194,15 +194,15 @@ protected function configurePanel()
{
$filesystem = (new Filesystem);

if (!$filesystem->isEmptyDirectory(app_path('Providers/Filament'))) {
if (! $filesystem->isEmptyDirectory(app_path('Providers/Filament'))) {
collect($filesystem->files(app_path('Providers/Filament')))
->map(fn(\SplFileInfo $fileInfo) => str($fileInfo->getFilename())
->map(fn (\SplFileInfo $fileInfo) => str($fileInfo->getFilename())
->before('.php')
->prepend("App\Providers\Filament")
->append('::class,')
->toString())
->each(
fn($value) => $this->replaceInFile(search: $value, replace: '', path: config_path('app.php'))
fn ($value) => $this->replaceInFile(search: $value, replace: '', path: config_path('app.php'))
);

$filesystem->deleteDirectory(app_path('Providers/Filament'));
Expand Down Expand Up @@ -303,12 +303,12 @@ protected function runCommands(array $commands): void
try {
$process->setTty(true);
} catch (\RuntimeException $e) {
$this->output->writeln(' <bg=yellow;fg=black> WARN </> '.$e->getMessage().PHP_EOL);
$this->output->writeln(' <bg=yellow;fg=black> WARN </> ' . $e->getMessage() . PHP_EOL);
}
}

$process->run(function ($type, $line) {
$this->output->write(' '.$line);
$this->output->write(' ' . $line);
});
}

Expand All @@ -326,14 +326,14 @@ protected function hasComposerPackage(string $package): bool
/**
* Installs the given Composer Packages into the application.
*/
protected function requireComposerPackages(array|string $packages): bool
protected function requireComposerPackages(array | string $packages): bool
{
$command = array_merge(
['composer', 'require'],
is_array($packages) ? $packages : func_get_args()
);

return !(new Process($command, base_path(), ['COMPOSER_MEMORY_LIMIT' => '-1']))
return ! (new Process($command, base_path(), ['COMPOSER_MEMORY_LIMIT' => '-1']))
->setTimeout(null)
->run(function ($type, $output) {
$this->output->write($output);
Expand Down

0 comments on commit c649dd5

Please sign in to comment.