From 3ceeced1f0f2e9e77e2a4ef955f693edfb1dbe86 Mon Sep 17 00:00:00 2001 From: Sadetdin EYILI Date: Wed, 2 Aug 2023 20:33:08 +0200 Subject: [PATCH] refactor: remove gc_collect_cycles() called twice for PHP < 8.1 Since https://github.com/Roave/no-leaks/pull/162 we only support PHP 8.1 and PHP 8.2 This code added in https://github.com/Roave/no-leaks/pull/124 is only for PHP 8.0 and PHP 7.4 --- src/CollectTestExecutionMemoryFootprints.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/CollectTestExecutionMemoryFootprints.php b/src/CollectTestExecutionMemoryFootprints.php index 25c2bed..9e44b27 100644 --- a/src/CollectTestExecutionMemoryFootprints.php +++ b/src/CollectTestExecutionMemoryFootprints.php @@ -23,8 +23,6 @@ use function memory_get_usage; use function sprintf; -use const PHP_VERSION_ID; - /** * Note: we need to implement TestListener, because the hook API is not allowing * us to interact with test suite instances. This means that the entire package @@ -52,9 +50,6 @@ public function startTestSuite(TestSuite $suite): void public function executeBeforeTest(string $test): void { gc_collect_cycles(); - if (PHP_VERSION_ID < 80100) { - gc_collect_cycles(); - } $this->preTestMemoryUsages[$test][] = memory_get_usage(); } @@ -62,9 +57,6 @@ public function executeBeforeTest(string $test): void public function executeAfterSuccessfulTest(string $test, float $time): void { gc_collect_cycles(); - if (PHP_VERSION_ID < 80100) { - gc_collect_cycles(); - } $this->postTestMemoryUsages[$test][] = memory_get_usage(); }