Skip to content

Commit

Permalink
PHPStan: fix the build
Browse files Browse the repository at this point in the history
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".
  • Loading branch information
jrfnl committed Aug 27, 2024
1 parent 72ec09b commit 0b496da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/RulesetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 . ' ';
}

Expand Down

0 comments on commit 0b496da

Please sign in to comment.