From 42b3736c39cd3112435f5c5a3546abce791eaa70 Mon Sep 17 00:00:00 2001 From: Yannick Gottschalk Date: Mon, 3 Jul 2023 10:24:26 +0200 Subject: [PATCH 1/2] Fixed psalm self test --- src/Psalm/Internal/Cli/Psalm.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Psalm/Internal/Cli/Psalm.php b/src/Psalm/Internal/Cli/Psalm.php index 76d5098c4..e10a5ddc3 100644 --- a/src/Psalm/Internal/Cli/Psalm.php +++ b/src/Psalm/Internal/Cli/Psalm.php @@ -41,7 +41,6 @@ use function array_map; use function array_merge; use function array_slice; use function array_sum; -use function array_unshift; use function array_values; use function chdir; use function count; @@ -185,11 +184,11 @@ final class Psalm } // debug CI environment - if (!in_array('--debug', $options, true) + if (!array_key_exists('debug', $options) && 'true' === getenv('GITHUB_ACTIONS') && '1' === getenv('RUNNER_DEBUG') ) { - array_unshift($options, '--debug'); + $options['debug'] = false; } self::forwardCliCall($options, $argv); From e819a608fbaba56a7f28f7cfc7a296bad632b3cf Mon Sep 17 00:00:00 2001 From: Yannick Gottschalk Date: Mon, 3 Jul 2023 10:40:54 +0200 Subject: [PATCH 2/2] Added issue suppression --- src/Psalm/Internal/Cli/Psalm.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Psalm/Internal/Cli/Psalm.php b/src/Psalm/Internal/Cli/Psalm.php index e10a5ddc3..4df6a9dd1 100644 --- a/src/Psalm/Internal/Cli/Psalm.php +++ b/src/Psalm/Internal/Cli/Psalm.php @@ -166,6 +166,7 @@ final class Psalm /** * @param array $argv + * @psalm-suppress ComplexMethod Maybe some of the option handling could be moved to its own function... */ public static function run(array $argv): void {