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 5059e48
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 ) ) {

Check failure on line 146 in tests/RulesetTest.php

View workflow job for this annotation

GitHub Actions / Basic CS and QA checks

Expected 1 spaces after opening parenthesis; 0 found

Check failure on line 146 in tests/RulesetTest.php

View workflow job for this annotation

GitHub Actions / Basic CS and QA checks

Expected 1 spaces before closing parenthesis; 0 found
$php = \PHP_BINARY . ' ';
}

Expand Down

0 comments on commit 5059e48

Please sign in to comment.