Skip to content

Commit d9953c9

Browse files
authored
fix: symfony console deprecation notice (#227)
* fix: symfony console deprecation notice * Fix styling
1 parent 5b4b8b1 commit d9953c9

File tree

6 files changed

+30
-6
lines changed

6 files changed

+30
-6
lines changed

src/Commands/BuildCommand.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@
1515
use Native\Electron\Traits\OsAndArch;
1616
use Native\Electron\Traits\PatchesPackagesJson;
1717
use Native\Electron\Traits\PrunesVendorDirectory;
18+
use Symfony\Component\Console\Attribute\AsCommand;
1819
use Symfony\Component\Process\Process as SymfonyProcess;
1920

2021
use function Laravel\Prompts\intro;
2122

23+
#[AsCommand(
24+
name: 'native:build',
25+
description: 'Build the NativePHP application for the specified operating system and architecture.',
26+
)]
2227
class BuildCommand extends Command
2328
{
2429
use CleansEnvFile;

src/Commands/BundleCommand.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@
1717
use Native\Electron\Traits\LocatesPhpBinary;
1818
use Native\Electron\Traits\PatchesPackagesJson;
1919
use Native\Electron\Traits\PrunesVendorDirectory;
20+
use Symfony\Component\Console\Attribute\AsCommand;
2021
use Symfony\Component\Finder\Finder;
2122
use ZipArchive;
2223

2324
use function Laravel\Prompts\intro;
2425

26+
#[AsCommand(
27+
name: 'native:bundle',
28+
description: 'Bundle your application for distribution.',
29+
)]
2530
class BundleCommand extends Command
2631
{
2732
use CleansEnvFile;
@@ -35,8 +40,6 @@ class BundleCommand extends Command
3540

3641
protected $signature = 'native:bundle {--fetch} {--clear} {--without-cleanup}';
3742

38-
protected $description = 'Bundle your application for distribution.';
39-
4043
private ?string $key;
4144

4245
private string $zipPath;

src/Commands/DevelopCommand.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@
88
use Native\Electron\Traits\Installer;
99
use Native\Electron\Traits\InstallsAppIcon;
1010
use Native\Electron\Traits\PatchesPackagesJson;
11+
use Symfony\Component\Console\Attribute\AsCommand;
1112

1213
use function Laravel\Prompts\intro;
1314
use function Laravel\Prompts\note;
1415

16+
#[AsCommand(
17+
name: 'native:serve',
18+
description: 'Start the NativePHP development server with the Electron app',
19+
)]
1520
class DevelopCommand extends Command
1621
{
1722
use CopiesCertificateAuthority;

src/Commands/InstallCommand.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@
55
use Illuminate\Console\Command;
66
use Native\Electron\Traits\Installer;
77
use RuntimeException;
8+
use Symfony\Component\Console\Attribute\AsCommand;
89

910
use function Laravel\Prompts\confirm;
1011
use function Laravel\Prompts\info;
1112
use function Laravel\Prompts\intro;
1213
use function Laravel\Prompts\note;
1314
use function Laravel\Prompts\outro;
1415

16+
#[AsCommand(
17+
name: 'native:install',
18+
description: 'Install all of the NativePHP resources',
19+
)]
1520
class InstallCommand extends Command
1621
{
1722
use Installer;
@@ -20,8 +25,6 @@ class InstallCommand extends Command
2025
{--force : Overwrite existing files by default}
2126
{--installer=npm : The package installer to use: npm, yarn or pnpm}';
2227

23-
protected $description = 'Install all of the NativePHP resources';
24-
2528
public function handle(): void
2629
{
2730
intro('Publishing NativePHP Service Provider...');

src/Commands/PublishCommand.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
use Illuminate\Support\Facades\Artisan;
77
use Native\Electron\Traits\LocatesPhpBinary;
88
use Native\Electron\Traits\OsAndArch;
9+
use Symfony\Component\Console\Attribute\AsCommand;
910

11+
#[AsCommand(
12+
name: 'native:publish',
13+
description: 'Build and publish the NativePHP app for the specified operating system and architecture',
14+
)]
1015
class PublishCommand extends Command
1116
{
1217
use LocatesPhpBinary;

src/Commands/ResetCommand.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@
44

55
use Illuminate\Console\Command;
66
use Native\Electron\Traits\PatchesPackagesJson;
7+
use Symfony\Component\Console\Attribute\AsCommand;
78
use Symfony\Component\Filesystem\Filesystem;
89

910
use function Laravel\Prompts\intro;
1011

12+
#[AsCommand(
13+
name: 'native:reset',
14+
description: 'Clear all build and dist files',
15+
)]
1116
class ResetCommand extends Command
1217
{
1318
use PatchesPackagesJson;
1419

1520
protected $signature = 'native:reset {--with-app-data : Clear the app data as well}';
1621

17-
protected $description = 'Clear all build and dist files';
18-
1922
public function handle(): int
2023
{
2124
intro('Clearing build and dist directories...');

0 commit comments

Comments
 (0)