From b9d2d3c0e576e50cb9b1052e0fbc36a0519c5383 Mon Sep 17 00:00:00 2001 From: Oleg Zhulnev Date: Mon, 11 Oct 2021 23:31:41 +0300 Subject: [PATCH] cast to int explicitly to avoid "Implicit conversion from float to int loses precision" --- src/TestFramework/Coverage/JUnit/TestLocationBucketSorter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TestFramework/Coverage/JUnit/TestLocationBucketSorter.php b/src/TestFramework/Coverage/JUnit/TestLocationBucketSorter.php index a731f65f58..96e147781d 100644 --- a/src/TestFramework/Coverage/JUnit/TestLocationBucketSorter.php +++ b/src/TestFramework/Coverage/JUnit/TestLocationBucketSorter.php @@ -78,7 +78,7 @@ public static function bucketSort(array $uniqueTestLocations): iterable // This is a very hot path. Factoring here another method just to test this math may not be as good idea. // Quick drop off lower bits, reducing precision to 8th of a second - $msTime = $location->getExecutionTime() * 1024 >> 7; // * 1024 / 128 + $msTime = (int) ($location->getExecutionTime() * 1024) >> 7; // * 1024 / 128 // For anything above 4 seconds reduce precision to 4 seconds if ($msTime > 32) {