Skip to content

Commit ede929f

Browse files
authored
Merge pull request #173 from sad270/refactor/remove-code-for-php-8.0
refactor: remove gc_collect_cycles() called twice for PHP < 8.1
2 parents cfaf91a + 3ceeced commit ede929f

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

src/CollectTestExecutionMemoryFootprints.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
use function memory_get_usage;
2424
use function sprintf;
2525

26-
use const PHP_VERSION_ID;
27-
2826
/**
2927
* Note: we need to implement TestListener, because the hook API is not allowing
3028
* us to interact with test suite instances. This means that the entire package
@@ -52,19 +50,13 @@ public function startTestSuite(TestSuite $suite): void
5250
public function executeBeforeTest(string $test): void
5351
{
5452
gc_collect_cycles();
55-
if (PHP_VERSION_ID < 80100) {
56-
gc_collect_cycles();
57-
}
5853

5954
$this->preTestMemoryUsages[$test][] = memory_get_usage();
6055
}
6156

6257
public function executeAfterSuccessfulTest(string $test, float $time): void
6358
{
6459
gc_collect_cycles();
65-
if (PHP_VERSION_ID < 80100) {
66-
gc_collect_cycles();
67-
}
6860

6961
$this->postTestMemoryUsages[$test][] = memory_get_usage();
7062
}

0 commit comments

Comments
 (0)