Skip to content

Commit

Permalink
replace extended-php with extended-laravel to add `OpensGeneratedFile…
Browse files Browse the repository at this point in the history
…s` trait
  • Loading branch information
d8vjork committed Aug 19, 2024
1 parent 9829d06 commit 1de3654
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
15 changes: 15 additions & 0 deletions src/Commands/DtoMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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.
*
Expand Down

0 comments on commit 1de3654

Please sign in to comment.