Skip to content

Commit 13116fa

Browse files
committed
Quantity bug fixed
1 parent fb734ec commit 13116fa

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/Component/Console/EcKeysetGeneratorCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ protected function configure(): void
3535

3636
protected function execute(InputInterface $input, OutputInterface $output)
3737
{
38-
$quantity = $input->getArgument('quantity');
39-
if (!\is_int($quantity)) {
38+
$quantity = (int) $input->getArgument('quantity');
39+
if ($quantity < 1) {
4040
throw new InvalidArgumentException('Invalid quantity');
4141
}
4242
$curve = $input->getArgument('curve');

src/Component/Console/OctKeysetGeneratorCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ protected function configure(): void
3535

3636
protected function execute(InputInterface $input, OutputInterface $output)
3737
{
38-
$quantity = $input->getArgument('quantity');
39-
$size = $input->getArgument('size');
40-
if (!\is_int($quantity)) {
38+
$quantity = (int) $input->getArgument('quantity');
39+
$size = (int) $input->getArgument('size');
40+
if ($quantity < 1) {
4141
throw new InvalidArgumentException('Invalid quantity');
4242
}
43-
if (!\is_int($size)) {
43+
if ($size < 1) {
4444
throw new InvalidArgumentException('Invalid size');
4545
}
4646

src/Component/Console/OkpKeysetGeneratorCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ protected function configure(): void
3535

3636
protected function execute(InputInterface $input, OutputInterface $output)
3737
{
38-
$quantity = $input->getArgument('quantity');
38+
$quantity = (int) $input->getArgument('quantity');
3939
$curve = $input->getArgument('curve');
40-
if (!\is_int($quantity)) {
40+
if ($quantity < 1) {
4141
throw new InvalidArgumentException('Invalid quantity');
4242
}
4343
if (!\is_string($curve)) {

src/Component/Console/RsaKeysetGeneratorCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ protected function configure(): void
3535

3636
protected function execute(InputInterface $input, OutputInterface $output)
3737
{
38-
$quantity = $input->getArgument('quantity');
39-
$size = $input->getArgument('size');
40-
if (!\is_int($quantity)) {
38+
$quantity = (int) $input->getArgument('quantity');
39+
$size = (int) $input->getArgument('size');
40+
if ($quantity < 1) {
4141
throw new InvalidArgumentException('Invalid quantity');
4242
}
43-
if (!\is_int($size)) {
43+
if ($size < 1) {
4444
throw new InvalidArgumentException('Invalid size');
4545
}
4646

0 commit comments

Comments
 (0)