From 11eeedc275f448438e4345d1fc6f01dd0fd5a4ca Mon Sep 17 00:00:00 2001 From: Eser DENIZ Date: Sun, 8 Jun 2025 17:56:34 +0200 Subject: [PATCH 1/2] fix: symfony console deprecation notice --- src/Commands/DebugCommand.php | 7 +++++-- src/Commands/FreshCommand.php | 6 ++++++ src/Commands/LoadPHPConfigurationCommand.php | 5 +++++ src/Commands/LoadStartupConfigurationCommand.php | 5 +++++ src/Commands/MigrateCommand.php | 7 +++++-- src/Commands/SeedDatabaseCommand.php | 9 +++++---- 6 files changed, 31 insertions(+), 8 deletions(-) diff --git a/src/Commands/DebugCommand.php b/src/Commands/DebugCommand.php index 2bb7633d..74b6b525 100644 --- a/src/Commands/DebugCommand.php +++ b/src/Commands/DebugCommand.php @@ -10,6 +10,7 @@ use Illuminate\Support\Facades\Process; use Native\Laravel\Support\Environment; +use Symfony\Component\Console\Attribute\AsCommand; use function Laravel\Prompts\error; use function Laravel\Prompts\info; use function Laravel\Prompts\intro; @@ -17,12 +18,14 @@ use function Laravel\Prompts\outro; use function Laravel\Prompts\select; +#[AsCommand( + name: 'native:debug', + description: 'Generate debug information required for opening an issue.', +)] class DebugCommand extends Command implements PromptsForMissingInput { protected $signature = 'native:debug {output}'; - protected $description = 'Generate debug information required for opening an issue.'; - private Collection $debugInfo; public function handle(): void diff --git a/src/Commands/FreshCommand.php b/src/Commands/FreshCommand.php index 96746c61..655df74b 100644 --- a/src/Commands/FreshCommand.php +++ b/src/Commands/FreshCommand.php @@ -4,7 +4,13 @@ use Illuminate\Database\Console\Migrations\FreshCommand as BaseFreshCommand; use Native\Laravel\NativeServiceProvider; +use Symfony\Component\Console\Attribute\AsCommand; + +#[AsCommand( + name: 'native:migrate:fresh', + description: 'Drop all tables and re-run all migrations in the NativePHP development environment', +)] class FreshCommand extends BaseFreshCommand { protected $name = 'native:migrate:fresh'; diff --git a/src/Commands/LoadPHPConfigurationCommand.php b/src/Commands/LoadPHPConfigurationCommand.php index 1a2ba579..c68899f9 100644 --- a/src/Commands/LoadPHPConfigurationCommand.php +++ b/src/Commands/LoadPHPConfigurationCommand.php @@ -4,7 +4,12 @@ use Illuminate\Console\Command; use Native\Laravel\Contracts\ProvidesPhpIni; +use Symfony\Component\Console\Attribute\AsCommand; +#[AsCommand( + name: 'native:php-ini', + description: 'Load the PHP configuration for the NativePHP development environment', +)] class LoadPHPConfigurationCommand extends Command { protected $signature = 'native:php-ini'; diff --git a/src/Commands/LoadStartupConfigurationCommand.php b/src/Commands/LoadStartupConfigurationCommand.php index c1907a21..540b55dc 100644 --- a/src/Commands/LoadStartupConfigurationCommand.php +++ b/src/Commands/LoadStartupConfigurationCommand.php @@ -3,7 +3,12 @@ namespace Native\Laravel\Commands; use Illuminate\Console\Command; +use Symfony\Component\Console\Attribute\AsCommand; +#[AsCommand( + name: 'native:config', + description: 'Load the startup configuration for the NativePHP development environment', +)] class LoadStartupConfigurationCommand extends Command { protected $signature = 'native:config'; diff --git a/src/Commands/MigrateCommand.php b/src/Commands/MigrateCommand.php index 9093d671..77ec5f3a 100644 --- a/src/Commands/MigrateCommand.php +++ b/src/Commands/MigrateCommand.php @@ -6,11 +6,14 @@ use Illuminate\Database\Console\Migrations\MigrateCommand as BaseMigrateCommand; use Illuminate\Database\Migrations\Migrator; use Native\Laravel\NativeServiceProvider; +use Symfony\Component\Console\Attribute\AsCommand; +#[AsCommand( + name: 'native:migrate', + description: 'Run the database migrations in the NativePHP development environment', +)] class MigrateCommand extends BaseMigrateCommand { - protected $description = 'Run the database migrations in the NativePHP development environment'; - public function __construct(Migrator $migrator, Dispatcher $dispatcher) { $this->signature = 'native:'.$this->signature; diff --git a/src/Commands/SeedDatabaseCommand.php b/src/Commands/SeedDatabaseCommand.php index cdc032e0..68b225a6 100644 --- a/src/Commands/SeedDatabaseCommand.php +++ b/src/Commands/SeedDatabaseCommand.php @@ -4,13 +4,14 @@ use Illuminate\Database\Console\Seeds\SeedCommand as BaseSeedCommand; use Native\Laravel\NativeServiceProvider; +use Symfony\Component\Console\Attribute\AsCommand; +#[AsCommand( + name: 'native:seed', + description: 'Seed the database in the NativePHP development environment', +)] class SeedDatabaseCommand extends BaseSeedCommand { - protected $name = 'native:db:seed'; - - protected $description = 'Run the database seeders in the NativePHP development environment'; - public function handle() { (new NativeServiceProvider($this->laravel))->rewriteDatabase(); From 4b08a22b0fc75bb133e05a151591812ec2f725e5 Mon Sep 17 00:00:00 2001 From: SRWieZ <1408020+SRWieZ@users.noreply.github.com> Date: Sun, 8 Jun 2025 15:57:17 +0000 Subject: [PATCH 2/2] Fix styling --- src/Commands/DebugCommand.php | 2 +- src/Commands/FreshCommand.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Commands/DebugCommand.php b/src/Commands/DebugCommand.php index 74b6b525..504ef7ba 100644 --- a/src/Commands/DebugCommand.php +++ b/src/Commands/DebugCommand.php @@ -9,8 +9,8 @@ use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\Process; use Native\Laravel\Support\Environment; - use Symfony\Component\Console\Attribute\AsCommand; + use function Laravel\Prompts\error; use function Laravel\Prompts\info; use function Laravel\Prompts\intro; diff --git a/src/Commands/FreshCommand.php b/src/Commands/FreshCommand.php index 655df74b..42e65f69 100644 --- a/src/Commands/FreshCommand.php +++ b/src/Commands/FreshCommand.php @@ -6,7 +6,6 @@ use Native\Laravel\NativeServiceProvider; use Symfony\Component\Console\Attribute\AsCommand; - #[AsCommand( name: 'native:migrate:fresh', description: 'Drop all tables and re-run all migrations in the NativePHP development environment',