Skip to content

Commit

Permalink
Add AsCommand attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
HypeMC committed May 28, 2022
1 parent b8e1616 commit ce43530
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Command/IncrementCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,21 @@
use Bizkit\VersioningBundle\VCS\VCSHandlerInterface;
use Bizkit\VersioningBundle\Version;
use Bizkit\VersioningBundle\Writer\WriterInterface;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\StyleInterface;
use Symfony\Component\Console\Style\SymfonyStyle;

#[AsCommand(self::DEFAULT_NAME, self::DEFAULT_DESCRIPTION)]
final class IncrementCommand extends Command
{
protected static $defaultName = 'bizkit:versioning:increment';
protected static $defaultDescription = 'Increments the version using the configured versioning strategy.';
public const DEFAULT_NAME = 'bizkit:versioning:increment';
public const DEFAULT_DESCRIPTION = 'Increments the version using the configured versioning strategy.';

protected static $defaultName = self::DEFAULT_NAME;
protected static $defaultDescription = self::DEFAULT_DESCRIPTION;

/**
* @var string
Expand Down Expand Up @@ -66,7 +71,7 @@ public function __construct(

protected function configure(): void
{
$this->setDescription(self::$defaultDescription);
$this->setDescription(self::DEFAULT_DESCRIPTION);
}

protected function execute(InputInterface $input, OutputInterface $output): int
Expand Down

0 comments on commit ce43530

Please sign in to comment.