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
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if (!$input->getOption('force') && \PHP_VERSION_ID < 80100) {
$output->write('<error>The new metadata system only works with PHP 8.1 and above.');

return Command::INVALID;
return \defined(Command::class.'::INVALID') ? Command::INVALID : 2;
}

if (!class_exists(NodeTraverser::class)) {
$output->writeln('Run `composer require --dev `nikic/php-parser` or install phpunit to use this command.');

return Command::FAILURE;
return \defined(Command::class.'::FAILURE') ? Command::FAILURE : 1;
}

$subresources = $this->getSubresources();
Expand Down Expand Up @@ -151,7 +151,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if (!class_exists(Differ::class)) {
$output->writeln('Run `composer require --dev sebastian/diff` or install phpunit to print a diff.');

return Command::FAILURE;
return \defined(Command::class.'::FAILURE') ? Command::FAILURE : 1;
}

$this->printDiff($oldCode, $newCode, $output);
Expand All @@ -161,7 +161,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
file_put_contents($fileName, $newCode);
}

return Command::SUCCESS;
return \defined(Command::class.'::SUCCESS') ? Command::SUCCESS : 0;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Bundle/Command/DebugResourceCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if (0 === \count($resourceCollection)) {
$output->writeln(sprintf('<error>No resources found for class %s</error>', $resourceClass));

return Command::INVALID;
return \defined(Command::class.'::INVALID') ? Command::INVALID : 2;
}

$shortName = (false !== $pos = strrpos($resourceClass, '\\')) ? substr($resourceClass, $pos + 1) : $resourceClass;
Expand Down Expand Up @@ -110,13 +110,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$this->dumper->dump($this->cloner->cloneVar($selectedResource));
$output->writeln('Successfully dumped the selected resource');

return Command::SUCCESS;
return \defined(Command::class.'::SUCCESS') ? Command::SUCCESS : 0;
}

$this->dumper->dump($this->cloner->cloneVar($resourceCollection->getOperation($answerOperation)));
$output->writeln('Successfully dumped the selected operation');

return Command::SUCCESS;
return \defined(Command::class.'::SUCCESS') ? Command::SUCCESS : 0;
}

public static function getDefaultName(): string
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/Command/GraphQlExportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->writeln($schemaExport);
}

return 0;
return \defined(Command::class.'::SUCCESS') ? Command::SUCCESS : 0;
}

public static function getDefaultName(): string
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Bundle/Command/OpenApiCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$filesystem->dumpFile($filename, $content);
$io->success(sprintf('Data written to %s.', $filename));

return 0;
return \defined(Command::class.'::SUCCESS') ? Command::SUCCESS : 0;
}

$output->writeln($content);

return 0;
return \defined(Command::class.'::SUCCESS') ? Command::SUCCESS : 0;
}

public static function getDefaultName(): string
Expand Down