Skip to content

Commit

Permalink
feat!: remove guid and comb options
Browse files Browse the repository at this point in the history
BREAKING CHANGE: removal of arguments from the generate command
  • Loading branch information
ramsey committed Dec 21, 2022
1 parent a71f743 commit eead59b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 31 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/continuous-integration.yml
Expand Up @@ -124,8 +124,13 @@ jobs:
dependency-versions: "${{ matrix.composer-deps }}"

- name: "Run unit tests (PHPUnit)"
if: "${{ matrix.composer-deps == 'highest' }}"
run: "composer dev:test:coverage:ci"

- name: "Run unit tests, with deprecation notices turned off (PHPUnit)"
if: "${{ matrix.composer-deps == 'lowest' }}"
run: "composer dev:test:coverage:ci -- -d 'error_reporting=E_ALL & ~E_DEPRECATED'"

- name: "Publish coverage report to Codecov"
uses: "codecov/codecov-action@v3.1.1"

Expand Down
31 changes: 0 additions & 31 deletions src/Command/GenerateCommand.php
Expand Up @@ -15,18 +15,14 @@
namespace Ramsey\Uuid\Console\Command;

use Ramsey\Uuid\Console\Exception;
use Ramsey\Uuid\FeatureSet;
use Ramsey\Uuid\Generator\CombGenerator;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidFactory;
use Ramsey\Uuid\UuidInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

use function assert;
use function filter_var;
use function method_exists;

Expand Down Expand Up @@ -70,18 +66,6 @@ protected function configure(): void
InputOption::VALUE_REQUIRED,
'Generate count UUIDs instead of just a single one.',
1,
)
->addOption(
'comb',
null,
InputOption::VALUE_NONE,
'For version 4 UUIDs, uses the COMB strategy to generate the random data.',
)
->addOption(
'guid',
'g',
InputOption::VALUE_NONE,
'Returns a GUID formatted UUID.',
);
}

Expand All @@ -98,21 +82,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
],
);

if ((bool) $input->getOption('guid') === true) {
$features = new FeatureSet(true);

Uuid::setFactory(new UuidFactory($features));
}

if ((bool) $input->getOption('comb') === true) {
$factory = Uuid::getFactory();
assert($factory instanceof UuidFactory);

$factory->setRandomGenerator(
new CombGenerator($factory->getRandomGenerator(), $factory->getNumberConverter()),
);
}

/** @var scalar $inputVersion */
$inputVersion = $input->getArgument('version');

Expand Down

0 comments on commit eead59b

Please sign in to comment.