From 0b496da8ec3fbb97d771a9666ddc05dafc49e728 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 27 Aug 2024 17:42:31 +0200 Subject: [PATCH] PHPStan: fix the build The last few builds were failing due to the below PHPStan error: ``` ------ --------------------------------- Line tests/RulesetTest.php ------ --------------------------------- 146 Left side of && is always true. ------ --------------------------------- ``` Fixed now. Note: the condition could possibly be removed, but I have a feeling I added it for a reason, so I left it in under the guise of "better safe than sorry". --- tests/RulesetTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/RulesetTest.php b/tests/RulesetTest.php index f6fed8fe..6c92e731 100644 --- a/tests/RulesetTest.php +++ b/tests/RulesetTest.php @@ -143,7 +143,7 @@ private function run() { */ private function collect_phpcs_result() { $php = ''; - if ( \PHP_BINARY && in_array( \PHP_SAPI, [ 'cgi-fcgi', 'cli', 'cli-server', 'phpdbg' ], true ) ) { + if ( defined( 'PHP_BINARY' ) && in_array( \PHP_SAPI, [ 'cgi-fcgi', 'cli', 'cli-server', 'phpdbg' ], true ) ) { $php = \PHP_BINARY . ' '; }