From db12ec3cbfce237622c84db68198e2b4a9747c5e Mon Sep 17 00:00:00 2001 From: neznaika0 Date: Sat, 4 Jan 2025 12:54:40 +0300 Subject: [PATCH] refactor: Fix phpstan condNotBoolean (#9368) --- system/CLI/CLI.php | 2 +- utils/phpstan-baseline/if.condNotBoolean.neon | 8 -------- utils/phpstan-baseline/loader.neon | 1 - 3 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 utils/phpstan-baseline/if.condNotBoolean.neon diff --git a/system/CLI/CLI.php b/system/CLI/CLI.php index fa77515e1ba8..0f1fe5dbce2c 100644 --- a/system/CLI/CLI.php +++ b/system/CLI/CLI.php @@ -289,7 +289,7 @@ public static function promptByKey($text, array $options, $validation = null): s CLI::isZeroOptions($options); - if ($line = array_shift($text)) { + if (($line = array_shift($text)) !== null) { CLI::write($line); } diff --git a/utils/phpstan-baseline/if.condNotBoolean.neon b/utils/phpstan-baseline/if.condNotBoolean.neon deleted file mode 100644 index 6e9b4b56f3fb..000000000000 --- a/utils/phpstan-baseline/if.condNotBoolean.neon +++ /dev/null @@ -1,8 +0,0 @@ -# total 1 error - -parameters: - ignoreErrors: - - - message: '#^Only booleans are allowed in an if condition, mixed given\.$#' - count: 1 - path: ../../system/CLI/CLI.php diff --git a/utils/phpstan-baseline/loader.neon b/utils/phpstan-baseline/loader.neon index b81067460d0e..150b8c87bf6d 100644 --- a/utils/phpstan-baseline/loader.neon +++ b/utils/phpstan-baseline/loader.neon @@ -21,7 +21,6 @@ includes: - generator.returnType.neon - generator.valueType.neon - greaterOrEqual.invalid.neon - - if.condNotBoolean.neon - isset.offset.neon - isset.property.neon - method.alreadyNarrowedType.neon