From 1de365451ceb292c4b3ca52c80c291146c9f5f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rube=CC=81n=20Robles?= Date: Mon, 19 Aug 2024 19:36:13 +0200 Subject: [PATCH] replace extended-php with extended-laravel to add `OpensGeneratedFiles` trait --- composer.json | 2 +- src/Commands/DtoMakeCommand.php | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index aff3405..f721fe6 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "php": "^8.1", "illuminate/http": "^9.0 || ^10.0 || ^11.0", "illuminate/support": "^9.0 || ^10.0 || ^11.0", - "open-southeners/extended-php": "~1.0", + "open-southeners/extended-laravel": "~0.1", "phpdocumentor/reflection-docblock": "^5.3", "symfony/property-info": "^6.0 || ^7.0" }, diff --git a/src/Commands/DtoMakeCommand.php b/src/Commands/DtoMakeCommand.php index f1744a3..a00f656 100644 --- a/src/Commands/DtoMakeCommand.php +++ b/src/Commands/DtoMakeCommand.php @@ -6,10 +6,13 @@ use Illuminate\Support\Str; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputOption; +use OpenSoutheners\ExtendedLaravel\Console\Concerns\OpensGeneratedFiles; #[AsCommand(name: 'make:dto')] class DtoMakeCommand extends GeneratorCommand { + use OpensGeneratedFiles; + /** * The console command name. * @@ -31,6 +34,18 @@ class DtoMakeCommand extends GeneratorCommand */ protected $type = 'DataTransferObject'; + /** + * Execute the console command. + * + * @return bool|null + * + * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException + */ + public function handle() + { + return $this->openGeneratedAfter(fn () => parent::handle()); + } + /** * Get the stub file for the generator. *