Skip to content

Commit 78ac06a

Browse files
committed
fixes
1 parent fed5f5c commit 78ac06a

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/Command/BisectCommand.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
143143
return 1;
144144
}
145145

146-
$commits = array_values(array_filter($commits, static function (array $commit) use ($checksumShas): bool {
147-
return isset($checksumShas[$commit['sha']]);
148-
}));
146+
$commits = array_values(array_filter($commits, static fn (array $commit): bool => isset($checksumShas[$commit['sha']])));
149147

150148
if (count($commits) === 0) {
151149
$io->error('No commits found that change phpstan.phar between the specified releases.');
@@ -318,12 +316,12 @@ private function getPharChecksumCommitShas(Client $client, string $bad, array $r
318316

319317
$foundOutOfRange = false;
320318
foreach ($commits as $commit) {
321-
if (isset($rangeShas[$commit['sha']])) {
322-
$checksumShas[$commit['sha']] = true;
323-
} else {
319+
if (!isset($rangeShas[$commit['sha']])) {
324320
$foundOutOfRange = true;
325321
break;
326322
}
323+
324+
$checksumShas[$commit['sha']] = true;
327325
}
328326

329327
if ($foundOutOfRange || count($commits) < $perPage) {

tests/PHPStan/Command/Bisect/BinarySearchTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use function array_search;
1010
use function count;
1111
use function range;
12+
use function sprintf;
1213

1314
class BinarySearchTest extends TestCase
1415
{
@@ -141,7 +142,7 @@ public static function dataFullBisect(): iterable
141142

142143
foreach ($lists as $name => $items) {
143144
foreach ($items as $badItem) {
144-
yield "$name, first bad is $badItem" => [$items, $badItem];
145+
yield sprintf('%s, first bad is %s', $name, $badItem) => [$items, $badItem];
145146
}
146147
}
147148
}

0 commit comments

Comments
 (0)