Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/SchemaDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function dump(
string $fqcn,
array $excludedTablesRegexes = [],
bool $formatted = false,
bool $nowdocOutput = false,
bool|null $nowdocOutput = null,
int $lineLength = 120,
): string {
$schema = $this->schemaManager->introspectSchema();
Expand Down
5 changes: 3 additions & 2 deletions src/Tools/Console/Command/DiffCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected function configure(): void
'nowdoc',
null,
InputOption::VALUE_NEGATABLE,
'Output the generated SQL as a nowdoc string (always active for formatted queries).',
'Output the generated SQL as a nowdoc string (enabled by default for formatted queries).',
)
->addOption(
'line-length',
Expand Down Expand Up @@ -108,7 +108,8 @@ protected function execute(
}

$formatted = filter_var($input->getOption('formatted'), FILTER_VALIDATE_BOOLEAN);
$nowdocOutput = filter_var($input->getOption('nowdoc'), FILTER_VALIDATE_BOOLEAN);
$nowdocOutput = $input->getOption('nowdoc');
$nowdocOutput = $nowdocOutput === null ? null : filter_var($input->getOption('nowdoc'), FILTER_VALIDATE_BOOLEAN);
$lineLength = (int) $input->getOption('line-length');
$allowEmptyDiff = $input->getOption('allow-empty-diff');
$checkDbPlatform = filter_var($input->getOption('check-database-platform'), FILTER_VALIDATE_BOOLEAN);
Expand Down
7 changes: 4 additions & 3 deletions src/Tools/Console/Command/DumpSchemaCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ protected function configure(): void
->addOption(
'nowdoc',
null,
InputOption::VALUE_NONE,
'Output the generated SQL as a nowdoc string (always active for formatted queries).',
InputOption::VALUE_NEGATABLE,
'Output the generated SQL as a nowdoc string (enabled by default for formatted queries).',
)
->addOption(
'namespace',
Expand Down Expand Up @@ -85,7 +85,8 @@ public function execute(
OutputInterface $output,
): int {
$formatted = filter_var($input->getOption('formatted'), FILTER_VALIDATE_BOOLEAN);
$nowdocOutput = filter_var($input->getOption('nowdoc'), FILTER_VALIDATE_BOOLEAN);
$nowdocOutput = $input->getOption('nowdoc');
$nowdocOutput = $nowdocOutput === null ? null : filter_var($input->getOption('nowdoc'), FILTER_VALIDATE_BOOLEAN);
$lineLength = (int) $input->getOption('line-length');

$schemaDumper = $this->getDependencyFactory()->getSchemaDumper();
Expand Down