Skip to content

Commit

Permalink
fix make:dto without request option makes a validated DTO
Browse files Browse the repository at this point in the history
  • Loading branch information
d8vjork committed Oct 11, 2023
1 parent 8818012 commit 959345c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Commands/DtoMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ class DtoMakeCommand extends GeneratorCommand
protected function getStub()
{
$stubSuffix = '';
$hasRequestOption = $this->hasOption('request');
$requestOption = $this->option('request');

if ($hasRequestOption) {
if ($requestOption !== false) {
$stubSuffix .= '.request';
}

if ($hasRequestOption && $this->option('request') === null) {
if ($requestOption === null) {
$stubSuffix .= '.plain';
}

Expand Down Expand Up @@ -214,7 +214,7 @@ protected function getOptions()
{
return [
['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the data transfer object already exists'],
['request', 'r', InputOption::VALUE_OPTIONAL, 'Create the class implementing ValidatedDataTransferObject interface & request method'],
['request', 'r', InputOption::VALUE_OPTIONAL, 'Create the class implementing ValidatedDataTransferObject interface & request method', false],
];
}
}

0 comments on commit 959345c

Please sign in to comment.