Skip to content

Commit

Permalink
Merge pull request #336 from loic425/fix/stub-command
Browse files Browse the repository at this point in the history
Fix Stub command
  • Loading branch information
loic425 authored Jun 5, 2024
2 parents 1e30f7f + 8d53b3a commit 21031d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Bundle/Command/StubCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@

abstract class StubCommand extends Command
{
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
(new SymfonyStyle($input, $output))
->error(
\sprintf("To run \"%s\" you need the \"%s\" which is currently not installed.\n\nTry running \"composer require %s\".", static::$defaultName ?? '', 'MakerBundle', 'symfony/maker-bundle --dev'),
\sprintf("To run \"%s\" you need the \"%s\" which is currently not installed.\n\nTry running \"composer require %s\".", static::getDefaultName() ?? '', 'MakerBundle', 'symfony/maker-bundle --dev'),
)
;

return 0;
return Command::SUCCESS;
}
}
4 changes: 3 additions & 1 deletion src/Bundle/Command/StubMakeGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@

namespace Sylius\Bundle\GridBundle\Command;

use Symfony\Component\Console\Attribute\AsCommand;

#[AsCommand(name: 'make:grid')]
final class StubMakeGrid extends StubCommand
{
protected static $defaultName = 'make:grid';
}

0 comments on commit 21031d7

Please sign in to comment.