Skip to content

Commit 3bfd93c

Browse files
committed
Bugs fixed
1 parent f1122b1 commit 3bfd93c

7 files changed

+9
-41
lines changed

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
parameters:
2-
level: 8
2+
level: 9
33
paths:
44
- src
55
checkMissingIterableValueType: false

src/Component/Console/EcKeysetGeneratorCommand.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,8 @@ protected function configure(): void
2929
protected function execute(InputInterface $input, OutputInterface $output): int
3030
{
3131
$quantity = $input->getArgument('quantity');
32-
if ($quantity === null) {
32+
if (!is_int($quantity)) {
3333
$quantity = 1;
34-
} elseif (is_array($quantity)) {
35-
$quantity = 1;
36-
} else {
37-
$quantity = (int) $quantity;
3834
}
3935
if ($quantity < 1) {
4036
throw new InvalidArgumentException('Invalid quantity');

src/Component/Console/OctKeyGeneratorCommand.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,8 @@ protected function configure(): void
2626
protected function execute(InputInterface $input, OutputInterface $output): int
2727
{
2828
$size = $input->getArgument('size');
29-
if ($size === null) {
29+
if (!is_int($size)) {
3030
$size = 1;
31-
} elseif (is_array($size)) {
32-
$size = 1;
33-
} else {
34-
$size = (int) $size;
3531
}
3632
if ($size < 1) {
3733
throw new InvalidArgumentException('Invalid size');

src/Component/Console/OctKeysetGeneratorCommand.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,13 @@ protected function configure(): void
2828
protected function execute(InputInterface $input, OutputInterface $output): int
2929
{
3030
$quantity = $input->getArgument('quantity');
31-
if ($quantity === null) {
31+
if (!is_int($quantity)) {
3232
$quantity = 1;
33-
} elseif (is_array($quantity)) {
34-
$quantity = 1;
35-
} else {
36-
$quantity = (int) $quantity;
3733
}
3834

3935
$size = $input->getArgument('size');
40-
if ($size === null) {
41-
$size = 1;
42-
} elseif (is_array($size)) {
36+
if (!is_int($size)) {
4337
$size = 1;
44-
} else {
45-
$size = (int) $size;
4638
}
4739
if ($quantity < 1) {
4840
throw new InvalidArgumentException('Invalid quantity');

src/Component/Console/OkpKeysetGeneratorCommand.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,8 @@ protected function configure(): void
2929
protected function execute(InputInterface $input, OutputInterface $output): int
3030
{
3131
$quantity = $input->getArgument('quantity');
32-
if ($quantity === null) {
32+
if (!is_int($quantity)) {
3333
$quantity = 1;
34-
} elseif (is_array($quantity)) {
35-
$quantity = 1;
36-
} else {
37-
$quantity = (int) $quantity;
3834
}
3935
$curve = $input->getArgument('curve');
4036
if ($quantity < 1) {

src/Component/Console/RsaKeyGeneratorCommand.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,8 @@ protected function configure(): void
2626
protected function execute(InputInterface $input, OutputInterface $output): int
2727
{
2828
$size = $input->getArgument('size');
29-
if ($size === null) {
29+
if (!is_int($size)) {
3030
$size = 1;
31-
} elseif (is_array($size)) {
32-
$size = 1;
33-
} else {
34-
$size = (int) $size;
3531
}
3632
$args = $this->getOptions($input);
3733
if ($size < 1) {

src/Component/Console/RsaKeysetGeneratorCommand.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,12 @@ protected function configure(): void
2828
protected function execute(InputInterface $input, OutputInterface $output): int
2929
{
3030
$quantity = $input->getArgument('quantity');
31-
if ($quantity === null) {
31+
if (!is_int($quantity)) {
3232
$quantity = 1;
33-
} elseif (is_array($quantity)) {
34-
$quantity = 1;
35-
} else {
36-
$quantity = (int) $quantity;
3733
}
3834
$size = $input->getArgument('size');
39-
if ($size === null) {
40-
$size = 1;
41-
} elseif (is_array($size)) {
35+
if (!is_int($size)) {
4236
$size = 1;
43-
} else {
44-
$size = (int) $size;
4537
}
4638
if ($quantity < 1) {
4739
throw new InvalidArgumentException('Invalid quantity');

0 commit comments

Comments
 (0)