Skip to content

Commit 11ed63d

Browse files
authored
fix(symfony): upgrade command requires phpunit (#4968)
fixes #4950
1 parent d099dd6 commit 11ed63d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Core/Bridge/Symfony/Bundle/Command/UpgradeApiResourceCommand.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8989
return Command::INVALID;
9090
}
9191

92+
if (!class_exists(NodeTraverser::class)) {
93+
$output->writeln('Run `composer require --dev `nikic/php-parser` or install phpunit to use this command.');
94+
95+
return Command::FAILURE;
96+
}
97+
9298
$subresources = $this->getSubresources();
9399

94100
$prettyPrinter = new Standard();
@@ -142,6 +148,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int
142148
continue;
143149
}
144150

151+
if (!class_exists(Differ::class)) {
152+
$output->writeln('Run `composer require --dev sebastian/diff` or install phpunit to print a diff.');
153+
154+
return Command::FAILURE;
155+
}
156+
145157
$this->printDiff($oldCode, $newCode, $output);
146158
continue;
147159
}

0 commit comments

Comments
 (0)